Blood detection method, device and system for medical examination based on image processing

By combining scale-invariant feature transformation and convolutional deep neural networks, a white blood cell detection model was established, which solved the problems of generalization difficulties and local information loss caused by small datasets, and improved the accuracy and efficiency of blood testing.

CN121921233APending Publication Date: 2026-04-24AFFILIATED HOSPITAL OF ZUNYI UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
AFFILIATED HOSPITAL OF ZUNYI UNIV
Filing Date
2023-10-25
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Existing blood testing methods cannot generalize accurately due to small datasets. Increasing the size and diversity of data samples is costly, results in poor data quality and high computational resource requirements. Model training is time-consuming and prone to losing local information, leading to a decrease in recognition rate.

Method used

By combining scale-invariant feature transform and convolutional deep neural networks, a white blood cell detection model is established to perform accurate classification by extracting the most predictable features and preserving spatial neighborhood dependencies. Local information is also preserved by normalizing the training sample matrix and the test sample matrix.

Benefits of technology

It improves the segmentation accuracy and recognition rate of white blood cell detection, solves the generalization problem caused by small datasets, reduces data collection and annotation costs, reduces computing resource requirements, and enhances resistance to changes in illumination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121921233A_ABST
    Figure CN121921233A_ABST
Patent Text Reader

Abstract

The invention discloses a blood detection method for medical examination based on image processing, a blood detection device for medical examination based on image processing and a blood detection system for medical examination based on image processing. Comprising an image acquisition module, a vectorization processing module, a projection module, a preprocessing module, a coarse segmentation module, a fine segmentation module, a feature extraction module, a detection model training module and a leukocyte classification module. The invention belongs to the technical field of blood detection, and particularly relates to a blood detection method, device and system for medical examination based on image processing. According to the scheme, scale invariant feature transformation and a convolutional deep neural network are combined, and most predictable features are extracted through the scale invariant feature transformation; the dependency of the spatial neighborhood is kept through the convolutional deep neural network, and different types of leukocytes are accurately classified through the leukocyte detection perfection model, so that the segmentation accuracy is further improved, and the effect of detecting and classifying the leukocytes in the blood is excellent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blood testing technology, specifically referring to a blood testing method, device, and system for medical testing based on image processing. Background Technology

[0002] In medical testing, detecting white blood cells in the blood can help doctors diagnose different diseases. When processing blood microscopic images, deep learning technology is usually used to classify five different types of white blood cells, thereby helping doctors to more accurately determine the type of disease and further develop a treatment plan.

[0003] However, due to the small available dataset, the model may over-rely on noisy or anomalous samples in the training set, resulting in an inability to accurately generalize to new images. Increasing the size of the data samples and the diversity of sample images can improve the accuracy and generalization ability of the model, but this approach is prone to problems such as high cost of data collection and annotation, poor data quality and the introduction of noise, long training time and high computational resource requirements, and increased model complexity. Therefore, the existing methods for detecting and classifying white blood cells in blood are still not ideal and need to further improve the segmentation accuracy. At the same time, during model training, existing methods are prone to losing local information, resulting in a decrease in recognition rate. Summary of the Invention

[0004] To address the aforementioned issues and overcome the shortcomings of existing technologies, this invention provides a blood detection method, apparatus, and system for medical testing based on image processing. Addressing the technical problems of small available datasets leading to inaccurate generalization to new images, and the drawbacks of increasing data sample size and image diversity resulting in high data acquisition and annotation costs, poor data quality and noise introduction, long training times and high computational resource requirements, and increased model complexity, this solution combines scale-invariant feature transformation (SIN) and convolutional deep neural networks (DNNs). SIN extracts the most predictable features, DNNs maintain spatial neighborhood dependencies, and white blood cell detection refines the model for accurate classification of different types of white blood cells, thereby further improving segmentation accuracy. This method achieves excellent accuracy in detecting and classifying white blood cells in blood, addressing the technical challenges of small datasets hindering accurate generalization to new images, and the increased costs of data collection and annotation, poor data quality and noise introduction, long training times and high computational resource requirements, and increased model complexity resulting from increased data sample size and image diversity. To address the issue of existing model training methods losing local information and thus reducing recognition rate, this solution normalizes the training sample matrix A and test sample y to achieve a normalized L2 norm, effectively preserving local information and improving recognition rate. Furthermore, this solution utilizes the three-dimensional vector of the a-th pixel in each blood microscopic image. Three different weighted vectors are calculated to obtain three weighted images, which are then subjected to preliminary and fine segmentation processing. This effectively eliminates the influence of color differences between image samples and the illumination intensity of cell nuclei. Furthermore, by introducing scale-invariant feature transformation, it exhibits high resistance to other complex transformations and illumination changes. By calculating the inner product of the three-dimensional vectors of the pixels in the blood micrograph, the cell nucleus region of the image has the highest brightness, while other parts of the image become darker, thus facilitating accurate segmentation of the cell nucleus region of white blood cells.

[0005] The technical solution adopted by this invention is as follows: The blood detection method for medical testing based on image processing provided by this invention includes: Step S1: Acquire blood microscopic images;

[0006] Step S2: Set the RGB value of each pixel in the blood micrograph to the three-dimensional vector of that pixel. This yields a three-dimensional vector set of blood microscopic images. ,in, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. This represents the color value of the red channel at the i-th pixel in a blood micrograph. This represents the color value of the green channel at the i-th pixel in a blood micrograph. This represents the color value of the blue channel of the i-th pixel in the blood micrograph, where k represents the total number of pixels in the blood micrograph. A three-dimensional vector representing the first pixel of a blood micrograph. A three-dimensional vector representing the k-th pixel in a blood micrograph;

[0007] Step S3: Calculate the inner product of the three-dimensional vectors of the pixels in the blood micrograph to obtain the projection set. ,in, Represents the projection set The first vector, Represents the projection set The k-th vector, where k represents the total number of pixels in the blood micrograph;

[0008] Step S4: For the three-dimensional vector set and projection set After processing, three weighted images are obtained;

[0009] Step S5: Perform preliminary segmentation on the three weighted images to obtain a coarse segmentation image;

[0010] Step S6: Perform fine segmentation processing on the coarsely segmented image to obtain a true cell nucleus segmentation image;

[0011] Step S7: Extract features from the real cell nucleus segmentation image to obtain a 128-dimensional feature vector;

[0012] Step S8: Establish a white blood cell detection model and train it to obtain a complete white blood cell detection model;

[0013] Step S9: Input the 128-dimensional feature vector into the white blood cell detection model to obtain the classification results of five different types of white blood cells.

[0014] As a further improvement to this scheme, in step S3, the step of calculating the inner product of the three-dimensional vectors of the pixels in the blood microscopic image includes: Step S31: Initialization, the initialization formula is: ;

[0015] In the formula, Represents the projection set The first vector, A three-dimensional vector representing the first pixel of a blood micrograph;

[0016] Step S32: Calculate the unit vector The unit vector The calculation formula is: ;

[0017] In the formula, Represents the projection set The first vector, Represents the projection set The first vector The model;

[0018] Step S33: Calculate the 3D vector v2 of the second pixel in the blood micrograph in the projection set. The projection of the second vector u2 onto the projection set of the three-dimensional vector v2 of the second pixel of the blood micrograph. The formula for calculating the projection onto the second vector u2 is: ;

[0019] In the formula, The three-dimensional vector v2 representing the second pixel of a blood micrograph in the projection set The projection onto the first vector u1, where u1 represents the set of projections. The first vector, v2, represents the three-dimensional vector of the second pixel in the blood micrograph. Represents the projection set The inner product of the first vector u1 and the three-dimensional vector v2 of the second pixel in the blood micrograph. Represents the projection set The first vector u1 and the projection set The inner product of the first vector u1;

[0020] Step S34: Calculate the projection set The i-th vector u i Where i is an integer between [2, k], the projection set The i-th vector u i The calculation formula is: ;

[0021] In the formula, u i Represents the projection set The i-th vector, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. The three-dimensional vector v representing the i-th pixel in a blood micrograph i In projection set The j-th vector u j The projection onto the surface, where j is an integer between [1, i], and i = j + 1. Represents the projection set The j-th vector;

[0022] Step S35: Calculate the unit vector The unit vector The calculation formula is: ;

[0023] In the formula, Represents the projection set The i-th vector, Represents the projection set The first vector The model;

[0024] Step S36: Calculate the three-dimensional vector v of the i-th pixel in the blood micrograph. i In projection set The (i-1)th vector u i-1 The projection onto the surface, the three-dimensional vector v of the i-th pixel of the blood micrograph. i In projection set The (i-1)th vector u i-1 The formula for calculating the projection on is: ;

[0025] In the formula, A three-dimensional vector representing the i-th pixel in a blood micrograph. In projection set The (i-1)th vector The projection on Represents the projection set The (i-1)th vector, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. Represents the projection set The (i-1)th vector The three-dimensional vector of the i-th pixel in the blood micrograph The inner product, Represents the projection set The (i-1)th vector With projection set The (i-1)th vector The inner product;

[0026] Step S37: i = i + 1, j = j + 1;

[0027] Step S38: Repeat steps S34 to S37 until the entire three-dimensional vector set has been traversed. All three-dimensional vectors in the vector set are used to obtain the projection set. .

[0028] As a further improvement to this scheme, in step S4, the three-dimensional vector set... and projection set The processing steps include: Step S41: For the three-dimensional vector of the a-th pixel in the blood micrograph Calculate its relationship with the projection set The b-th vector u b The inner product of the a-th pixel in the blood micrograph is the three-dimensional vector. With projection set The b-th vector u b The formula for calculating the inner product on the surface is: ;

[0029] In the formula, A three-dimensional vector representing the a-th pixel in a blood micrograph. With projection set The b-th vector u b Inner product on, Represents the projection set The b-th vector The three-dimensional vector of the a-th pixel in the blood micrograph The inner product, Represents the projection set The b-th vector With projection set The b-th vector The inner product;

[0030] Step S42: Develop a three-dimensional vector for the a-th pixel in each blood micrograph. Three different weighting vectors are calculated by multiplying each projection result by the corresponding weight coefficient to obtain three weighted images. The formulas for calculating the three different weighting vectors are as follows: ;

[0031] ;

[0032] ;

[0033] In the formula, , and These represent weighting coefficients, used to control the importance of different weighted vectors. , and This represents three different weighted vectors. Represents the projection set The first vector, Represents the projection set The second vector, Represents the projection set The third vector, The vector represents the a-th pixel in a blood micrograph.

[0034] As a further improvement to this scheme, in step S5, the step of performing preliminary segmentation processing on the three weighted images includes: Step S51: Calculate the histograms of the three weighted images respectively;

[0035] Step S52: Set a segmentation threshold by analyzing the histograms of the three weighted images;

[0036] Step S53: Set the regions with pixel values ​​greater than or equal to the segmentation threshold in the three weighted images as cell nucleus regions, and set the regions with pixel values ​​less than the segmentation threshold as background regions to obtain coarse segmentation images.

[0037] Further, in step S6, the step of performing fine segmentation processing on the coarsely segmented image includes: Step S61: Preset area threshold;

[0038] Step S62: Divide the segmented nucleus region into multiple connected components, remove connected components with an area smaller than the area threshold, and retain only the connected components containing the nucleus;

[0039] Step S63: Retain the connected components containing cell nuclei at the corresponding pixel positions of the three weighted images, and set the connected components containing cell nuclei at the corresponding pixel positions of the three weighted images as connected components of the real cell nuclei, and set the other parts as background, to obtain the real cell nucleus segmentation image.

[0040] Further, in step S7, the step of extracting features from the real cell nucleus segmentation image includes: Step S71: Using a series of Gaussian kernel functions A convolution operation is performed on the real cell nucleus segmentation image to generate a set of smoothed images, where each smoothed image uses a different standard deviation σ. The Gaussian kernel function with standard deviation σ at coordinates (x, y) is used.

[0041] Step S72: Subtract adjacent smoothed images to obtain a set of Gaussian difference images;

[0042] Step S73: Perform local extremum detection on each Gaussian difference image, compare each pixel with its neighboring pixels, and select the local maximum and local minimum points as key points;

[0043] Step S74: Accurately locate the key points to obtain a 128-dimensional feature vector.

[0044] Further, in step S74, the step of precisely locating the key points includes: Step S741: Calculate the gradient magnitude and gradient direction of the region surrounding the key point;

[0045] Step S742: Divide the surrounding area into multiple 16×16 sub-regions centered on the key point, count the gradient direction of the pixels in each sub-region, and construct a gradient direction histogram.

[0046] Step S743: Concatenate the gradient direction histograms of multiple small sub-regions into a 128-dimensional feature vector.

[0047] Further, in step S8, the step of establishing and training the white blood cell detection model includes: Step S81: Learn the filter from the 128-dimensional feature vector and its gradient to obtain the filter set. ,in, Represents a filter set The first filter, Represents a filter set The second filter, Represents a filter set The nrth filter;

[0048] Step S82: Convolve the filter set on the 128-dimensional feature vectors For each filter, the feature map corresponding to each filter is obtained, and the set of convolutional filters on the 128-dimensional feature vector is described. The calculation formula for each filter is: ;

[0049] In the formula, Represents the filter set The feature map corresponding to the Lth filter, Represents the filter set The Lth filter, and X represents a 128-dimensional eigenvector;

[0050] Step S83: Transmit the feature map corresponding to each filter through a nonlinear activation function to introduce nonlinear characteristics, thereby obtaining the feature map corresponding to each filter after applying the nonlinear activation function. The calculation formula for transmitting the feature map corresponding to each filter through the nonlinear activation function is as follows: ;

[0051] In the formula, This represents the feature map corresponding to the k-th filter after applying the nonlinear activation function. Represents a non-linear activation function. Represents the filter set The feature map corresponding to the kth filter;

[0052] Step S84: For the filter set Max pooling is performed on the feature map corresponding to each filter to obtain the maximum value of the feature map generated by each filter within a specific neighborhood G, and a two-dimensional feature map matrix M is generated. The formula for calculating the max pooling operation on the feature map corresponding to each filter is as follows: ;

[0053] In the formula, G represents a specific neighborhood G, that is, the region covered by the pooling window in the max pooling operation. This represents the feature map corresponding to the i-th filter after applying the nonlinear activation function, where i represents the index. This represents the result obtained after the max pooling operation, that is, the maximum value of the feature map generated by each filter within a specific neighborhood G. This indicates finding the maximum value of the feature map generated by each filter within a specific neighborhood G;

[0054] Step S85: Flatten the two-dimensional feature mapping matrix M to obtain a one-dimensional vector V;

[0055] Step S86: Input the one-dimensional vector V into the fully connected layer to obtain the output of each neuron. The formula for calculating the output of each neuron is as follows: ;

[0056] In the formula, This represents the output of the k-th neuron. Let N represent the activation function, N represent the number of neurons, and i represent the index of the neuron. This represents the weights between k neurons and the i-th element of a one-dimensional vector V. Let i represent the i-th element of a one-dimensional vector V. This represents the bias term of the k-th neuron;

[0057] Step S87: Input the training sample matrix and test samples Where N represents the number of training samples, m represents the number of features per sample, and R represents the range of real numbers. Let represent an m×N real number matrix, where the elements of the matrix are of type real numbers. Let y represent an m×1 real number vector, where the vector elements are of type real numbers, and y represents the test sample, which is an m×1 vector.

[0058] Step S88: Normalize the training sample matrix A and the test sample y so that the training sample matrix A and the test sample y have normalized L2 norm;

[0059] Step S89: Calculate the nearest neighbor;

[0060] In step S89, the step of calculating the nearest neighbor includes: Step S891: Calculate W, wherein the formula for calculating W is: ;

[0061] In the formula, W represents a diagonal matrix and a local adapter, used to penalize the distance between y and each test sample. This represents the difference between the test sample y and the training sample y. The distance between them This represents the difference between the test sample y and the training sample y. The distance between them This represents the difference between the test sample y and the training sample y. The distance between them, N represents the number of training samples, and diag represents placing the elements of a vector in order on the diagonal to form a diagonal matrix;

[0062] Step S892: Calculate the linear representation of the test sample, wherein the formula for calculating the linear representation of the test sample is: ;

[0063] In the formula, This represents a linear representation of the test samples. Represents the training sample matrix , Represents the training sample matrix Let be the transpose of , y represent a test sample, t represent a constant, W represent a diagonal matrix, and W represents a local adapter used to penalize the distance between y and each test sample. Indicates the transpose of W;

[0064] Step S810: Calculate the residuals of all training samples, and select the M training samples with the smallest residuals to construct a matrix. The formula for calculating the residuals of the training samples is: ;

[0065] In the formula, Let y represent the residual of the i-th training sample, i.e., y and The Euclidean distance, where y represents the test sample. Describing the L2 norm, This represents the i-th training sample. This represents the feature vector of the i-th training sample;

[0066] Step S811: Calculate the linear combination of M training samples, wherein the formula for calculating the linear combination of the M training samples is: ;

[0067] In the formula, It is a positive constant. It is the identity matrix. This represents a linear combination of M training samples. Representation matrix ; Representation matrix The transpose of , where y represents the test sample;

[0068] Step S812: Check the cooperation value of the training samples of each category when representing the test sample, and determine the category of the test sample as the category with the lowest cooperation value. The formula for calculating the cooperation value of the training samples of each category when representing the test sample is as follows: ;

[0069] In the formula, This represents the collaboration value of the training sample of the i-th category when representing the test sample. Let y represent the L2 norm and y represent the test sample. This represents the number of training samples for the i-th category. This represents the weight of the j-th training sample in the i-th category. This represents the feature representation of the j-th training sample in the i-th category.

[0070] Step S813: Calculate the cross-entropy loss function and train the entire white blood cell detection model using the backpropagation algorithm;

[0071] Step S814: Repeat the above steps until the convergence condition is met to obtain a complete model for white blood cell detection.

[0072] The present invention provides a blood testing device for medical testing based on image processing, comprising an image acquisition module, a vectorization processing module, a projection module, a preprocessing module, a coarse segmentation module, a fine segmentation module, a feature extraction module, a detection model training module, and a white blood cell classification module; the image acquisition module acquires a blood microscopic image and sends the blood microscopic image to the vectorization processing module; the vectorization processing module sets the RGB value of each pixel in the blood microscopic image as a three-dimensional vector of that pixel. This yields a three-dimensional vector set of blood microscopic images. and the three-dimensional vector set of blood microscopic images The image is sent to the projection module and the preprocessing module; the projection module calculates the inner product of the three-dimensional vectors of the pixels in the blood micrograph to obtain the projection set. and project set Send to the preprocessing module; the preprocessing module processes the three-dimensional vector set. and projection set The system processes the data to obtain three weighted images, which are then sent to a coarse segmentation module. The coarse segmentation module performs preliminary segmentation on the three weighted images to obtain coarse segmentation images, which are then sent to a fine segmentation module. The fine segmentation module performs fine segmentation on the coarse segmentation images to obtain real cell nucleus segmentation images, which are then sent to a feature extraction module. The feature extraction module extracts features from the real cell nucleus segmentation images to obtain a 128-dimensional feature vector, which is then sent to a detection model training module and a white blood cell classification module. The detection model training module establishes and trains a white blood cell detection model to obtain a refined white blood cell detection model, which is then sent to a white blood cell classification module. The white blood cell classification module inputs the 128-dimensional feature vector into the refined white blood cell detection model to obtain classification results for five different types of white blood cells.

[0073] The present invention provides a blood testing system for medical testing based on image processing, comprising a memory and a processor, wherein the processor executes a computer program stored in the memory.

[0074] The beneficial effects achieved by the present invention using the above solution are as follows: (1) To address the technical problems that a small available dataset can lead to inaccurate generalization to new images, while increasing the size of the data sample and the diversity of the sample images can lead to high costs for data collection and annotation, poor data quality and the introduction of noise, long training time and high computational resource requirements, and increased model complexity, this solution combines scale-invariant feature transformation and convolutional deep neural networks. The scale-invariant feature transformation is used to extract the most predictable features, the convolutional deep neural network is used to maintain the spatial neighborhood dependency, and the white blood cell detection is used to improve the model to accurately classify different types of white blood cells, thereby further improving the segmentation accuracy. The detection and classification of white blood cells in blood is very effective, solving the technical problems that a small available dataset can lead to inaccurate generalization to new images, while increasing the size of the data sample and the diversity of the sample images can lead to high costs for data collection and annotation, poor data quality and the introduction of noise, long training time and high computational resource requirements, and increased model complexity.

[0075] (2) In view of the technical problem that the existing model training method is prone to losing local information, which leads to a decrease in recognition rate, this solution normalizes the training sample matrix A and the test sample y, so that the training sample matrix A and the test sample y have normalized L2 norm, thereby effectively preserving local information and improving the recognition rate.

[0076] (3) This scheme uses the three-dimensional vector of the a-th pixel in each blood micrograph. Three different weighted vectors are calculated to obtain three weighted images, which are then subjected to preliminary and fine segmentation processing. This effectively eliminates the influence of color differences between image samples and the illumination intensity of cell nuclei. Furthermore, by introducing scale-invariant feature transformation, it exhibits high resistance to other complex transformations and illumination changes. By calculating the inner product of the three-dimensional vectors of the pixels in the blood micrograph, the cell nucleus region of the image has the highest brightness, while other parts of the image become darker, thus facilitating accurate segmentation of the cell nucleus region of white blood cells. Attached Figure Description

[0077] Figure 1 This is a schematic flowchart of the image processing-based blood testing method for medical testing provided by the present invention;

[0078] Figure 2 This is a flowchart illustrating step S3;

[0079] Figure 3 This is a flowchart illustrating step S4;

[0080] Figure 4 This is a flowchart illustrating step S5;

[0081] Figure 5This is a flowchart illustrating step S6;

[0082] Figure 6 This is a flowchart illustrating step S7;

[0083] Figure 7 This is a flowchart illustrating step S74;

[0084] Figure 8 This is a flowchart illustrating step S8;

[0085] Figure 9 This is a flowchart illustrating step S89;

[0086] Figure 10 This is a schematic diagram of the structure of the blood testing device for medical testing based on image processing provided by the present invention.

[0087] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Detailed Implementation

[0088] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0089] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0090] Example 1, see Figure 1 The present invention provides a blood testing method for medical testing based on image processing, comprising: Step S1: Acquire blood microscopic images;

[0091] Step S2: Set the RGB value of each pixel in the blood micrograph to the three-dimensional vector of that pixel. This yields a three-dimensional vector set of blood microscopic images. ,in, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. This represents the color value of the red channel at the i-th pixel in a blood micrograph. This represents the color value of the green channel at the i-th pixel in a blood micrograph. This represents the color value of the blue channel of the i-th pixel in the blood micrograph, where k represents the total number of pixels in the blood micrograph. A three-dimensional vector representing the first pixel of a blood micrograph. A three-dimensional vector representing the k-th pixel in a blood micrograph;

[0092] Step S3: Calculate the inner product of the three-dimensional vectors of the pixels in the blood micrograph to obtain the projection set. ,in, Represents the projection set The first vector, Represents the projection set The k-th vector, where k represents the total number of pixels in the blood micrograph;

[0093] Step S4: For the three-dimensional vector set and projection set After processing, three weighted images are obtained;

[0094] Step S5: Perform preliminary segmentation on the three weighted images to obtain a coarse segmentation image;

[0095] Step S6: Perform fine segmentation processing on the coarsely segmented image to obtain a true cell nucleus segmentation image;

[0096] Step S7: Extract features from the real cell nucleus segmentation image to obtain a 128-dimensional feature vector;

[0097] Step S8: Establish a white blood cell detection model and train it to obtain a complete white blood cell detection model;

[0098] Step S9: Input the 128-dimensional feature vector into the white blood cell detection model to obtain the classification results of five different types of white blood cells;

[0099] In the above operations, this scheme combines scale-invariant feature transformation and convolutional deep neural networks. The scale-invariant feature transformation extracts the most predictable features, the convolutional deep neural network maintains the spatial neighborhood dependency, and the white blood cell detection improves the model to accurately classify different types of white blood cells, thereby further improving the segmentation accuracy. The detection and classification of white blood cells in blood is extremely effective. This solves the technical problems that a small available dataset may lead to inaccurate generalization to new images, while increasing the data sample size and the diversity of sample images may lead to high data collection and annotation costs, poor data quality and the introduction of noise, long training time and high computational resource requirements, and increased model complexity.

[0100] Example 2, this example is based on the above example, see reference. Figure 2 and Figure 3 In step S3, the step of calculating the inner product of the three-dimensional vectors of the pixels in the blood micrograph includes: Step S31: Initialization, the initialization formula is: ;

[0101] In the formula, Represents the projection set The first vector, A three-dimensional vector representing the first pixel of a blood micrograph;

[0102] Step S32: Calculate the unit vector The unit vector The calculation formula is: ;

[0103] In the formula, Represents the projection set The first vector, Represents the projection set The first vector The model;

[0104] Step S33: Calculate the 3D vector v2 of the second pixel in the blood micrograph in the projection set. The projection of the second vector u2 onto the projection set of the three-dimensional vector v2 of the second pixel of the blood micrograph. The formula for calculating the projection onto the second vector u2 is: ;

[0105] In the formula, The three-dimensional vector v2 representing the second pixel of a blood micrograph in the projection set The projection onto the first vector u1, where u1 represents the set of projections. The first vector, v2, represents the three-dimensional vector of the second pixel in the blood micrograph. Represents the projection set The inner product of the first vector u1 and the three-dimensional vector v2 of the second pixel in the blood micrograph. Represents the projection set The first vector u1 and the projection set The inner product of the first vector u1;

[0106] Step S34: Calculate the projection set The i-th vector u i Where i is an integer between [2, k], the projection set The i-th vector u i The calculation formula is: ;

[0107] In the formula, u i Represents the projection set The i-th vector, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. The three-dimensional vector v representing the i-th pixel in a blood micrograph i In projection set The j-th vector u j The projection onto the surface, where j is an integer between [1, i], and i = j + 1. Represents the projection set The j-th vector;

[0108] Step S35: Calculate the unit vector The unit vector The calculation formula is: ;

[0109] In the formula, Represents the projection set The i-th vector, Represents the projection set The first vector The model;

[0110] Step S36: Calculate the three-dimensional vector v of the i-th pixel in the blood micrograph. i In projection set The (i-1)th vector u i-1 The projection onto the surface, the three-dimensional vector v of the i-th pixel of the blood micrograph. i In projection set The (i-1)th vector u i-1 The formula for calculating the projection on is: ;

[0111] In the formula, A three-dimensional vector representing the i-th pixel in a blood micrograph. In projection set The (i-1)th vector The projection on Represents the projection set The (i-1)th vector, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. Represents the projection set The (i-1)th vector The three-dimensional vector of the i-th pixel in the blood micrograph The inner product, Represents the projection set The (i-1)th vector With projection set The (i-1)th vector The inner product;

[0112] Step S37: i = i + 1, j = j + 1;

[0113] Step S38: Repeat steps S34 to S37 until the entire three-dimensional vector set has been traversed. All three-dimensional vectors in the vector set are used to obtain the projection set. ;

[0114] In step S4, the three-dimensional vector set and projection set The processing steps include: Step S41: For the three-dimensional vector of the a-th pixel in the blood micrograph Calculate its relationship with the projection set The b-th vector u b The inner product of the a-th pixel in the blood micrograph is the three-dimensional vector. With projection set The b-th vector u b The formula for calculating the inner product on the surface is: ;

[0115] In the formula, A three-dimensional vector representing the a-th pixel in a blood micrograph. With projection set The b-th vector u b Inner product on, Represents the projection set The b-th vector The three-dimensional vector of the a-th pixel in the blood micrograph The inner product, Represents the projection set The b-th vector With projection set The b-th vector The inner product;

[0116] Step S42: Develop a three-dimensional vector for the a-th pixel in each blood micrograph. Three different weighting vectors are calculated by multiplying each projection result by the corresponding weight coefficient to obtain three weighted images. The formulas for calculating the three different weighting vectors are as follows: ;

[0117] ;

[0118] ;

[0119] In the formula, , and These represent weighting coefficients, used to control the importance of different weighted vectors. , and This represents three different weighted vectors. Represents the projection set The first vector, Represents the projection set The second vector, Represents the projection set The third vector, The three-dimensional vector representing the a-th pixel in a blood micrograph;

[0120] In the above operation, because the cell nucleus contains substances such as DNA and nucleoproteins, which strongly reflect and absorb light, the cell nucleus region appears as a bright color in the image, usually purple or dark blue. However, because the nucleus of white blood cells is relatively small and contains less DNA and nucleoproteins, the nucleus region of white blood cells usually has a lower brightness intensity, which is not conducive to the segmentation of the nucleus region of white blood cells. However, by calculating the inner product of the three-dimensional vectors of the pixels in the blood micrograph, the nucleus region of the image has the highest brightness, while other parts of the image will be darkened, thus facilitating the accurate segmentation of the nucleus region of white blood cells.

[0121] Example 3, this example is based on the above examples, see reference. Figure 4 In step S5, the preliminary segmentation process of the three weighted images includes: Step S51: Calculate the histograms of the three weighted images respectively;

[0122] Step S52: Set a segmentation threshold by analyzing the histograms of the three weighted images;

[0123] Step S53: Set the regions with pixel values ​​greater than or equal to the segmentation threshold in the three weighted images as cell nucleus regions, and set the regions with pixel values ​​less than the segmentation threshold as background regions to obtain coarse segmentation images.

[0124] Example 4, this example is based on the above examples, see below. Figure 5 In step S6, the step of performing fine segmentation processing on the coarsely segmented image includes: Step S61: Preset area threshold;

[0125] Step S62: Divide the segmented nucleus region into multiple connected components, remove connected components with an area smaller than the area threshold, and retain only the connected components containing the nucleus;

[0126] Step S63: Retain the connected components containing cell nuclei at the corresponding pixel positions of the three weighted images, and set the connected components containing cell nuclei at the corresponding pixel positions of the three weighted images as connected components of the real cell nuclei, and set the other parts as background to obtain the real cell nucleus segmentation image.

[0127] By performing the above operations, the effects of color differences between image samples and the intensity of light on cell nuclei can be effectively eliminated.

[0128] Example 5, this example is based on the above examples, see below. Figure 6 In step S7, the step of extracting features from the real cell nucleus segmentation image includes: Step S71: Using a series of Gaussian kernel functions A convolution operation is performed on the real cell nucleus segmentation image to generate a set of smoothed images, where each smoothed image uses a different standard deviation σ. The Gaussian kernel function with standard deviation σ at coordinates (x, y) is used.

[0129] Step S72: Subtract adjacent smoothed images to obtain a set of Gaussian difference images;

[0130] Step S73: Perform local extremum detection on each Gaussian difference image, compare each pixel with its neighboring pixels, and select the local maximum and local minimum points as key points;

[0131] Step S74: Accurately locate the key points to obtain a 128-dimensional feature vector;

[0132] In the above operation, the most predictable features are extracted by introducing scale-invariant feature transformation, and it can exhibit high resistance to other complex forms of transformation and illumination changes.

[0133] Example 6, this example is based on the above examples, see below. Figure 7 In step S74, the step of accurately locating the key points includes: Step S741: Calculate the gradient magnitude and gradient direction of the region surrounding the key point;

[0134] Step S742: Divide the surrounding area into multiple 16×16 sub-regions centered on the key point, count the gradient direction of the pixels in each sub-region, and construct a gradient direction histogram.

[0135] Step S743: Concatenate the gradient direction histograms of multiple small sub-regions into a 128-dimensional feature vector.

[0136] Example 7, this example is based on the above examples, see below. Figure 8 and Figure 9 In step S8, the step of establishing and training the white blood cell detection model includes: Step S81: Learn the filter from the 128-dimensional feature vector and its gradient to obtain the filter set. ,in, Represents the filter set The first filter, Represents the filter set The second filter, Represents the filter set The nrth filter;

[0137] Step S82: Convolve the filter set on the 128-dimensional feature vectors For each filter, the feature map corresponding to each filter is obtained, and the set of convolutional filters on the 128-dimensional feature vector is described. The calculation formula for each filter is: ;

[0138] In the formula, Represents the filter set The feature map corresponding to the Lth filter, Represents the filter set The Lth filter, and X represents a 128-dimensional eigenvector;

[0139] Step S83: Transmit the feature map corresponding to each filter through a nonlinear activation function to introduce nonlinear characteristics, thereby obtaining the feature map corresponding to each filter after applying the nonlinear activation function. The calculation formula for transmitting the feature map corresponding to each filter through the nonlinear activation function is as follows: ;

[0140] In the formula, This represents the feature map corresponding to the k-th filter after applying the nonlinear activation function. Represents a non-linear activation function. Represents the filter set The feature map corresponding to the kth filter;

[0141] Step S84: For the filter set Max pooling is performed on the feature map corresponding to each filter to obtain the maximum value of the feature map generated by each filter within a specific neighborhood G, and a two-dimensional feature map matrix M is generated. The formula for calculating the max pooling operation on the feature map corresponding to each filter is as follows: ;

[0142] In the formula, G represents a specific neighborhood G, that is, the region covered by the pooling window in the max pooling operation. This represents the feature map corresponding to the i-th filter after applying the nonlinear activation function, where i represents the index. This represents the result obtained after the max pooling operation, that is, the maximum value of the feature map generated by each filter within a specific neighborhood G. This indicates finding the maximum value of the feature map generated by each filter within a specific neighborhood G;

[0143] Step S85: Flatten the two-dimensional feature mapping matrix M to obtain a one-dimensional vector V;

[0144] Step S86: Input the one-dimensional vector V into the fully connected layer to obtain the output of each neuron. The formula for calculating the output of each neuron is as follows: ;

[0145] In the formula, This represents the output of the k-th neuron. Let N represent the activation function, N represent the number of neurons, and i represent the index of the neuron. This represents the weights between k neurons and the i-th element of a one-dimensional vector V. Let i represent the i-th element of a one-dimensional vector V. This represents the bias term of the k-th neuron;

[0146] Step S87: Input the training sample matrix Test samples Where N represents the number of training samples, m represents the number of features per sample, and R represents the range of real numbers. Let represent an m×N real number matrix, where the elements of the matrix are of type real numbers. Let y represent an m×1 real number vector, where the vector elements are of type real numbers, and y represents the test sample, which is an m×1 vector.

[0147] Step S88: Normalize the training sample matrix A and the test sample y so that the training sample matrix A and the test sample y have normalized L2 norm;

[0148] Step S89: Calculate the nearest neighbor;

[0149] In step S89, the step of calculating the nearest neighbor includes: Step S891: Calculate W, wherein the formula for calculating W is: ;

[0150] In the formula, W represents a diagonal matrix and a local adapter, used to penalize the distance between y and each test sample. This represents the difference between the test sample y and the training sample y. The distance between them This represents the difference between the test sample y and the training sample y. The distance between them This represents the difference between the test sample y and the training sample y. The distance between them, N represents the number of training samples, and diag represents placing the elements of a vector in order on the diagonal to form a diagonal matrix;

[0151] Step S892: Calculate the linear representation of the test sample, wherein the formula for calculating the linear representation of the test sample is: ;

[0152] In the formula, This represents a linear representation of the test samples. Represents the training sample matrix , Represents the training sample matrix Let be the transpose of , y represent a test sample, t represent a constant, W represent a diagonal matrix, and W represents a local adapter used to penalize the distance between y and each test sample. Indicates the transpose of W;

[0153] Step S810: Calculate the residuals of all training samples, and select the M training samples with the smallest residuals to construct a matrix. The formula for calculating the residuals of the training samples is: ;

[0154] In the formula, Let y represent the residual of the i-th training sample, i.e., y and The Euclidean distance, where y represents the test sample. Describing the L2 norm, This represents the i-th training sample. This represents the feature vector of the i-th training sample;

[0155] Step S811: Calculate the linear combination of M training samples, wherein the formula for calculating the linear combination of the M training samples is: ;

[0156] In the formula, It is a positive constant. It is the identity matrix. This represents a linear combination of M training samples. Representation matrix ; Representation matrix The transpose of , where y represents the test sample;

[0157] Step S812: Check the cooperation value of the training samples of each category when representing the test sample, and determine the category of the test sample as the category with the lowest cooperation value. The formula for calculating the cooperation value of the training samples of each category when representing the test sample is as follows: ;

[0158] In the formula, This represents the collaboration value of the training sample of the i-th category when representing the test sample. Let y represent the L2 norm and y represent the test sample. This represents the number of training samples for the i-th category. This represents the weight of the j-th training sample in the i-th category. This represents the feature representation of the j-th training sample in the i-th category;

[0159] Step S813: Calculate the cross-entropy loss function and train the entire white blood cell detection model using the backpropagation algorithm;

[0160] Step S814: Repeat the above steps until the convergence condition is met to obtain a complete model for white blood cell detection;

[0161] In the above operations, this scheme normalizes the training sample matrix A and the test sample y to give them a normalized L2 norm, thereby effectively preserving local information, improving the recognition rate, and solving the technical problem that existing model training methods easily lose local information, resulting in a decrease in recognition rate; and maintains the spatial neighborhood dependency through a convolutional deep neural network.

[0162] Example 8, this example is based on the above examples, see below. Figure 10 The present invention provides a blood testing device for medical testing based on image processing, comprising an image acquisition module, a vectorization processing module, a projection module, a preprocessing module, a coarse segmentation module, a fine segmentation module, a feature extraction module, a detection model training module, and a white blood cell classification module; the image acquisition module acquires a blood microscopic image and sends the blood microscopic image to the vectorization processing module; the vectorization processing module sets the RGB value of each pixel in the blood microscopic image as a three-dimensional vector of that pixel. This yields a three-dimensional vector set of blood microscopic images. and the three-dimensional vector set of blood microscopic images The image is sent to the projection module and the preprocessing module; the projection module calculates the inner product of the three-dimensional vectors of the pixels in the blood micrograph to obtain the projection set. and project set Send to the preprocessing module;

[0163] The preprocessing module processes the three-dimensional vector set. and projection set The system processes the data to obtain three weighted images, which are then sent to a coarse segmentation module. The coarse segmentation module performs preliminary segmentation on the three weighted images to obtain coarse segmentation images, which are then sent to a fine segmentation module. The fine segmentation module performs fine segmentation on the coarse segmentation images to obtain real cell nucleus segmentation images, which are then sent to a feature extraction module. The feature extraction module extracts features from the real cell nucleus segmentation images to obtain a 128-dimensional feature vector, which is then sent to a detection model training module and a white blood cell classification module. The detection model training module establishes and trains a white blood cell detection model to obtain a refined white blood cell detection model, which is then sent to a white blood cell classification module. The white blood cell classification module inputs the 128-dimensional feature vector into the refined white blood cell detection model to obtain classification results for five different types of white blood cells.

[0164] Example 9, based on the above examples, provides an image processing-based blood testing system for medical testing, including a memory and a processor, wherein the processor executes a computer program stored in the memory.

[0165] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0166] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

[0167] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.

Claims

1. A blood testing method for medical examination based on image processing, characterized in that, include: Step S1: Acquire blood microscopic images; Step S2: Set the RGB value of each pixel in the blood micrograph to the three-dimensional vector of that pixel. This yields a three-dimensional vector set of blood microscopic images. ,in, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. This represents the color value of the red channel at the i-th pixel in a blood micrograph. This represents the color value of the green channel at the i-th pixel in a blood micrograph. This represents the color value of the blue channel of the i-th pixel in the blood micrograph, where k represents the total number of pixels in the blood micrograph. A three-dimensional vector representing the first pixel of a blood micrograph. A three-dimensional vector representing the k-th pixel in a blood micrograph; Step S3: Calculate the inner product of the three-dimensional vectors of the pixels in the blood micrograph to obtain the projection set. ,in, Represents the projection set The first vector, Represents the projection set The k-th vector, where k represents the total number of pixels in the blood micrograph; Step S4: For the three-dimensional vector set and projection set After processing, three weighted images are obtained; Step S5: Perform preliminary segmentation on the three weighted images to obtain a coarse segmentation image; Step S6: Perform fine segmentation processing on the coarsely segmented image to obtain a true cell nucleus segmentation image; Step S7: Extract features from the real cell nucleus segmentation image to obtain a 128-dimensional feature vector; Step S8: Establish a white blood cell detection model and train it to obtain a complete white blood cell detection model; Step S9: Input the 128-dimensional feature vector into the white blood cell detection model to obtain the classification results of five different types of white blood cells.

2. The blood detection method for medical testing based on image processing according to claim 1, characterized in that: In step S3, the step of calculating the inner product of the three-dimensional vectors of the pixels in the blood micrograph includes: Step S31: Initialization, the initialization formula is: ; In the formula, Represents the projection set The first vector, A three-dimensional vector representing the first pixel of a blood micrograph; Step S32: Calculate the unit vector The unit vector The calculation formula is: ; In the formula, Represents the projection set The first vector, Represents the projection set The first vector The model; Step S33: Calculate the 3D vector v2 of the second pixel in the blood micrograph in the projection set. The projection of the second vector u2 onto the projection set of the three-dimensional vector v2 of the second pixel of the blood micrograph. The formula for calculating the projection onto the second vector u2 is: ; In the formula, The three-dimensional vector v2 representing the second pixel of a blood micrograph in the projection set The projection onto the first vector u1, where u1 represents the set of projections. The first vector, v2, represents the three-dimensional vector of the second pixel in the blood micrograph. Represents the projection set The inner product of the first vector u1 and the three-dimensional vector v2 of the second pixel in the blood micrograph. Represents the projection set The first vector u1 and the projection set The inner product of the first vector u1; Step S34: Calculate the projection set The i-th vector u i Where i is an integer between [2, k], the projection set The i-th vector u i The calculation formula is: ; In the formula, u i Represents the projection set The i-th vector, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. The three-dimensional vector v representing the i-th pixel in a blood micrograph i In projection set The j-th vector u j The projection onto the surface, where j is an integer between [1, i], and i = j + 1. Represents the projection set The j-th vector; Step S35: Calculate the unit vector The unit vector The calculation formula is: ; In the formula, Represents the projection set The i-th vector, Represents the projection set The first vector The model; Step S36: Calculate the three-dimensional vector v of the i-th pixel in the blood micrograph. i In projection set The (i-1)th vector u i-1 The projection onto the surface, the three-dimensional vector v of the i-th pixel of the blood micrograph. i In projection set The (i-1)th vector u i-1 The formula for calculating the projection on is: ; In the formula, A three-dimensional vector representing the i-th pixel in a blood micrograph. In projection set The (i-1)th vector The projection on Represents the projection set The (i-1)th vector, Let represent the three-dimensional vector of the i-th pixel in a blood micrograph. Represents the projection set The (i-1)th vector The three-dimensional vector of the i-th pixel in the blood micrograph The inner product, Represents the projection set The (i-1)th vector With projection set The (i-1)th vector The inner product; Step S37: i = i + 1, j = j + 1; Step S38: Repeat steps S34 to S37 until the entire three-dimensional vector set has been traversed. All three-dimensional vectors are used to obtain the projection set. .

3. The blood detection method for medical testing based on image processing according to claim 2, characterized in that: In step S4, the three-dimensional vector set and projection set The processing steps include: Step S41: For the three-dimensional vector of the a-th pixel in the blood micrograph Calculate its relationship with the projection set The b-th vector u b The inner product of the a-th pixel in the blood micrograph is the three-dimensional vector. With projection set The b-th vector u b The formula for calculating the inner product is: ; In the formula, A three-dimensional vector representing the a-th pixel in a blood micrograph. With projection set The b-th vector u b Inner product on, Represents the projection set The b-th vector The three-dimensional vector of the a-th pixel in the blood micrograph The inner product, Represents the projection set The b-th vector With projection set The b-th vector The inner product; Step S42: Develop a three-dimensional vector for the a-th pixel in each blood micrograph. Three different weighting vectors are calculated by multiplying each projection result by the corresponding weight coefficient to obtain three weighted images. The formulas for calculating the three different weighting vectors are as follows: ; ; ; In the formula, , and These represent weighting coefficients, used to control the importance of different weighted vectors. , and This represents three different weighted vectors. Represents the projection set The first vector, Represents the projection set The second vector, Represents the projection set The third vector, The vector represents the a-th pixel in a blood micrograph.

4. The image processing-based blood testing method for medical examination according to claim 3, characterized in that: In step S5, the preliminary segmentation process of the three weighted images includes: Step S51: Calculate the histograms of the three weighted images respectively; Step S52: Set a segmentation threshold by analyzing the histograms of the three weighted images; Step S53: Set the regions with pixel values ​​greater than or equal to the segmentation threshold in the three weighted images as cell nucleus regions, and set the regions with pixel values ​​less than the segmentation threshold as background regions to obtain coarse segmentation images.

5. The blood testing method for medical examination based on image processing according to claim 4, characterized in that: In step S6, the step of performing fine segmentation processing on the coarsely segmented image includes: Step S61: Preset area threshold; Step S62: Divide the segmented nucleus region into multiple connected components, remove connected components with an area smaller than the area threshold, and retain only the connected components containing the nucleus; Step S63: Retain the connected components containing cell nuclei at the corresponding pixel positions of the three weighted images, and set the connected components containing cell nuclei at the corresponding pixel positions of the three weighted images as connected components of the real cell nuclei, and set the other parts as background, to obtain the real cell nucleus segmentation image.

6. The image processing-based blood testing method for medical examinations according to claim 4, characterized in that: In step S7, the step of extracting features from the real cell nucleus segmentation image includes: Step S71: Using a series of Gaussian kernel functions A convolution operation is performed on the real cell nucleus segmentation image to generate a set of smoothed images, where each smoothed image uses a different standard deviation σ. The Gaussian kernel function with standard deviation σ at coordinates (x, y) is used. Step S72: Subtract adjacent smoothed images to obtain a set of Gaussian difference images; Step S73: Perform local extremum detection on each Gaussian difference image, compare each pixel with its neighboring pixels, and select the local maximum and local minimum points as key points; Step S74: Accurately locate the key points to obtain a 128-dimensional feature vector.

7. The blood detection method for medical testing based on image processing according to claim 6, characterized in that: In step S74, the step of accurately locating the key points includes: Step S741: Calculate the gradient magnitude and gradient direction of the region surrounding the key point; Step S742: Divide the surrounding area into multiple 16×16 sub-regions centered on the key point, count the gradient direction of the pixels in each sub-region, and construct a gradient direction histogram. Step S743: Concatenate the gradient direction histograms of multiple small sub-regions into a 128-dimensional feature vector.

8. The image processing-based blood testing method for medical examination according to claim 7, characterized in that: In step S8, the step of establishing and training the white blood cell detection model includes: Step S81: Learn the filter from the 128-dimensional feature vector and its gradient to obtain the filter set. ,in, Represents a filter set The first filter, Represents a filter set The second filter, Represents a filter set The nrth filter; Step S82: Convolve the filter set on the 128-dimensional feature vectors For each filter, the feature map corresponding to each filter is obtained, and the set of convolutional filters on the 128-dimensional feature vector is described. The calculation formula for each filter is: ; In the formula, Represents a filter set The feature map corresponding to the Lth filter, Represents a filter set The Lth filter, and X represents a 128-dimensional eigenvector; Step S83: Transmit the feature map corresponding to each filter through a nonlinear activation function to introduce nonlinear characteristics, thereby obtaining the feature map corresponding to each filter after applying the nonlinear activation function. The calculation formula for transmitting the feature map corresponding to each filter through the nonlinear activation function is as follows: ; In the formula, This represents the feature map corresponding to the k-th filter after applying the nonlinear activation function. Represents a non-linear activation function. Represents a filter set The feature map corresponding to the kth filter; Step S84: For the filter set Max pooling is performed on the feature map corresponding to each filter to obtain the maximum value of the feature map generated by each filter within a specific neighborhood G, and a two-dimensional feature map matrix M is generated. The formula for calculating the max pooling operation on the feature map corresponding to each filter is as follows: ; In the formula, G represents a specific neighborhood G, that is, the region covered by the pooling window in the max pooling operation. This represents the feature map corresponding to the i-th filter after applying the nonlinear activation function, where i represents the index. This represents the result obtained after the max pooling operation, that is, the maximum value of the feature map generated by each filter within a specific neighborhood G. This indicates finding the maximum value of the feature map generated by each filter within a specific neighborhood G; Step S85: Flatten the two-dimensional feature mapping matrix M to obtain a one-dimensional vector V; Step S86: Input the one-dimensional vector V into the fully connected layer to obtain the output of each neuron. The formula for calculating the output of each neuron is as follows: ; In the formula, This represents the output of the k-th neuron. Let N represent the activation function, N represent the number of neurons, and i represent the index of the neuron. This represents the weight between the k-th neuron and the i-th element of the one-dimensional vector V. Let i represent the i-th element of a one-dimensional vector V. This represents the bias term of the k-th neuron; Step S87: Input the training sample matrix and test samples Where N represents the number of training samples, m represents the number of features per sample, and R represents the range of real numbers. Let represent an m×N real number matrix, where the elements of the matrix are of type real numbers. Let y represent an m×1 real number vector, where the vector elements are of type real numbers, and y represents the test sample, which is an m×1 vector. Step S88: Normalize the training sample matrix A and the test sample y so that the training sample matrix A and the test sample y have normalized L2 norm; Step S89: Calculate the nearest neighbor; In step S89, the step of calculating the nearest neighbor includes: Step S891: Calculate W, wherein the formula for calculating W is: ; In the formula, W represents a diagonal matrix and a local adapter, used to penalize the distance between y and each test sample. This represents the difference between the test sample y and the training sample y. The distance between them This represents the difference between the test sample y and the training sample y. The distance between them This represents the difference between the test sample y and the training sample y. The distance between them, N represents the number of training samples, and diag represents placing the elements of a vector in order on the diagonal to form a diagonal matrix; Step S892: Calculate the linear representation of the test sample, wherein the formula for calculating the linear representation of the test sample is: ; In the formula, This represents a linear representation of the test samples. Represents the training sample matrix , Represents the training sample matrix Let be the transpose of , y represent a test sample, t represent a constant, W represent a diagonal matrix, and W represents a local adapter used to penalize the distance between y and each test sample. Indicates the transpose of W; Step S810: Calculate the residuals of all training samples, and select the M training samples with the smallest residuals to construct a matrix. The formula for calculating the residuals of the training samples is: ; In the formula, Let y represent the residual of the i-th training sample, i.e., y and The Euclidean distance, where y represents the test sample. Describing the L2 norm, This represents the i-th training sample. This represents the feature vector of the i-th training sample; Step S811: Calculate the linear combination of M training samples, wherein the formula for calculating the linear combination of the M training samples is: ; In the formula, It is a positive constant. It is the identity matrix. This represents a linear combination of M training samples. Representation matrix ; Representation matrix The transpose of , where y represents the test sample; Step S812: Check the cooperation value of the training samples of each category when representing the test sample, and determine the category of the test sample as the category with the lowest cooperation value. The formula for calculating the cooperation value of the training samples of each category when representing the test sample is as follows: ; In the formula, This represents the collaboration value of the training sample of the i-th category when representing the test sample. Let y represent the L2 norm and y represent the test sample. This represents the number of training samples for the i-th category. This represents the weight of the j-th training sample in the i-th category. This represents the feature representation of the j-th training sample in the i-th category; Step S813: Calculate the cross-entropy loss function and train the entire white blood cell detection model using the backpropagation algorithm; Step S814: Repeat the above steps until the convergence condition is met to obtain a complete model for white blood cell detection.

9. A blood testing device for medical testing based on image processing, used to implement the blood testing method for medical testing based on image processing as described in any one of claims 1-8, characterized in that, It includes an image acquisition module, a vectorization processing module, a projection module, a preprocessing module, a coarse segmentation module, a fine segmentation module, a feature extraction module, a detection model training module, and a white blood cell classification module; The image acquisition module acquires blood microscopic images and sends them to the vectorization processing module; The vectorization module sets the RGB value of each pixel in the blood micrograph as a three-dimensional vector of that pixel. This yields a three-dimensional vector set of blood microscopic images. and the three-dimensional vector set of blood microscopic images Send to the projection module and preprocessing module; The projection module calculates the inner product of the three-dimensional vectors of the pixels in the blood micrograph to obtain the projection set. and project set Send to the preprocessing module; The preprocessing module processes the three-dimensional vector set. and projection set The process yields three weighted images, which are then sent to the coarse segmentation module. The coarse segmentation module performs preliminary segmentation on the three weighted images to obtain a coarse segmentation image, and then sends the coarse segmentation image to the fine segmentation module. The fine segmentation module performs fine segmentation processing on the coarse segmentation image to obtain a real cell nucleus segmentation image, and sends the real cell nucleus segmentation image to the feature extraction module; The feature extraction module extracts features from the real cell nucleus segmentation image to obtain a 128-dimensional feature vector, and sends the 128-dimensional feature vector to the detection model training module and the white blood cell classification module. The detection model training module establishes and trains a white blood cell detection model to obtain a complete white blood cell detection model, and then sends the complete white blood cell detection model to the white blood cell classification module. The white blood cell classification module inputs a 128-dimensional feature vector into the white blood cell detection and improvement model to obtain classification results for five different types of white blood cells.

10. A blood testing system for medical testing based on image processing, comprising a memory and a processor, characterized in that, The processor executes the computer program stored in the memory to implement the image processing-based blood testing method for medical examination as described in any one of claims 1-8.