Blood component analysis method, system and equipment based on particle swarm optimization and medium

The analysis of blood sample images through particle swarm algorithm solves the pain and timeliness of traditional blood component detection, and achieves fast and efficient blood component prediction, suitable for blood component analysis in homes and communities.

CN120388399APending Publication Date: 2025-07-29JIANGMEN POLYTECHNIC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510297235.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Existing blood component testing requires relying on professional laboratories, which leads to increased patient pain and infection risk, and the detection time is long, making it difficult to meet the needs of families and communities in rapid monitoring, and is insufficient timeliness.

Method used

A blood component analysis method based on particle swarm algorithm is used to obtain blood sample images for pre-processing, color feature extraction, principal component analysis and particle swarm algorithm prediction to generate blood component result maps.

Benefits of technology

It realizes rapid and efficient prediction of blood components, improves prediction accuracy and efficiency, is suitable for rapid monitoring of homes and communities, and reduces detection costs and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120388399A_ABST
    Figure CN120388399A_ABST
Patent Text Reader

Abstract

The invention discloses a blood component analysis method, system and device based on a particle swarm optimization and a medium, and the method comprises the steps: obtaining a plurality of blood sample images and actual component information corresponding to the blood sample images, and carrying out the preprocessing of all blood sample images; performing color feature extraction on all the preprocessed to-be-detected images to obtain a color feature vector of each to-be-detected image; performing feature dimension reduction on the color feature vectors of all the to-be-detected images to obtain blood component data; performing blood component prediction on the color feature vector and the blood component data to obtain a component prediction result; drawing a scatter diagram according to the blood sample image and the component prediction result, and drawing an error curve according to the component prediction result and the actual component information; and generating a blood component result map according to the scatter diagram and the error curve. According to the embodiment of the invention, the method can achieve the efficient analysis of the blood sample image, and facilitates the improvement of the prediction efficiency and prediction precision of blood components.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blood testing technology, and in particular to a blood component analysis method, system, device and medium based on particle swarm optimization. Background Art

[0002] With the growing public demand for medical services and the need for rapid diagnosis of diseases, accurate detection of blood components plays a vital role in disease diagnosis, evaluation of treatment effects, and monitoring of daily health status.

[0003] In the existing technology, the measurement of blood components usually requires reliance on professional laboratory testing. However, this type of traditional detection method has many problems in practical applications. On the one hand, the detection process requires blood drawing, which not only increases the patient's pain and infection risk, but also makes it difficult to widely promote this detection method in civilian scenarios such as homes and communities. On the other hand, the measurement time is long. From sample collection, transportation, laboratory processing to the final result issuance, it often takes hours or even days, which may cause the results to be delayed and cannot meet the urgent need for rapid monitoring in clinical and daily health monitoring. Especially in emergency medical situations or real-time health tracking, its lack of timeliness is more prominent. Summary of the Invention

[0004] The embodiments of the present application provide a blood component analysis method, system, device and medium based on a particle swarm algorithm, which can achieve efficient analysis of blood sample images, thereby facilitating improved efficiency and accuracy of blood component prediction.

[0005] In a first aspect, an embodiment of the present application provides a blood component analysis method based on a particle swarm optimization algorithm, the method comprising: Acquire multiple blood sample images and actual component information corresponding to the blood sample images, and perform preprocessing operations on all the blood sample images to obtain multiple images to be tested; Performing color feature extraction on all the images to be tested to obtain a color feature vector for each image to be tested; Performing feature dimension reduction on the color feature vectors of all the images to be tested based on a preset principal component analysis method to obtain blood component data; Performing blood component prediction on the color feature vector and the blood component data using a preset particle swarm algorithm to obtain a component prediction result; Drawing a scatter plot based on the blood sample image and the component prediction result, and drawing an error curve based on the component prediction result and the actual component information; A blood component result graph is generated according to the scatter plot and the error curve.

[0006] In some embodiments, the preprocessing operation on all the blood sample images to obtain a plurality of images to be tested includes: Performing a denoising operation on all the blood sample images; Performing image segmentation on the denoised blood sample images through a preset image segmentation algorithm to obtain blood region images; Performing illumination equalization processing on the blood region images to obtain a plurality of images to be tested.

[0007] In some embodiments, the extraction of color features from all the images to be tested to obtain the color feature vectors of each image to be tested includes: For each image to be tested, traversing all the pixel points of the image to be tested to determine the color component information of each pixel point; For each preset channel, determining the channel average value of the image to be tested under the preset channel and the distribution condition under the preset channel according to the color component information; Performing color conversion on the image to be tested based on the color component information to obtain a color space image; Extracting the hue information, saturation information and brightness information of the color space image; Generating the color feature vector of the image to be tested according to the channel average value, the distribution condition, the hue information, the saturation information and the brightness information.

[0008] In some embodiments, the dimensionality reduction of the color feature vectors of all the images to be tested based on a preset principal component analysis method to obtain blood component data includes: Performing data standardization processing on the color feature vectors of the images to be tested to obtain a data matrix; Calculating the covariance matrix of the data matrix and performing eigenvalue decomposition on the covariance matrix to obtain target feature vectors and target eigenvalues corresponding to the target feature vectors; Sorting the target feature vectors based on the target eigenvalues to screen out the principal component feature vectors with a preset ranking; Mapping the data matrix to the principal component feature vectors to obtain blood component data.

[0009] In some embodiments, the prediction of blood components on the color feature vectors and the blood component data through a preset particle swarm algorithm to obtain a component prediction result includes: Setting the initial particle swarm position and updating the velocity; Inputting the initial particle swarm position, the color feature vectors and the blood component data into a preset prediction model for fitness evaluation and outputting a prediction value; Calculating a prediction error value between the prediction value and the position of the initialized particle swarm using a preset error function; Adjusting the initialized particle swarm position and the update speed according to the prediction error value, and recording the current adjustment number and the update error value corresponding to the current adjustment number until the current adjustment number reaches a preset number of iterations or the update error value reaches a preset error value; Adjusting the model parameters of the prediction model based on the updated error value to obtain a pre-trained prediction model; The color feature vector and the blood component data are input into a pre-trained prediction model to perform blood component prediction, and a component prediction result is output.

[0010] In some embodiments, drawing a scatter plot based on the blood sample image and the component prediction result includes: classifying the blood sample image to obtain multiple blood sample types; Determining a predicted hemoglobin concentration, a predicted white blood cell count, and a predicted hematocrit corresponding to each type of the blood sample according to the component prediction results; A first scatter plot is drawn according to the type of the blood sample and the predicted hemoglobin concentration, a second scatter plot is drawn according to the type of the blood sample and the predicted white blood cell count, and a third scatter plot is drawn according to the type of the blood sample and the predicted hematocrit.

[0011] In some embodiments, the actual component information includes a plurality of sub-component information, and the component prediction result includes sub-prediction results corresponding one-to-one to the sub-component information; and drawing an error curve based on the component prediction result and the actual component information includes: Record the index value of each sub-prediction result; For each sub-component information, calculating a data error value of the sub-component information and a sub-prediction result corresponding to the sub-component information; An error curve is drawn based on the index value and the data error value.

[0012] In a second aspect, an embodiment of the present application further provides a blood component analysis system based on a particle swarm algorithm, the system comprising: a data acquisition module, configured to acquire a plurality of blood sample images and actual component information corresponding to the blood sample images, and perform a preprocessing operation on all the blood sample images to obtain a plurality of images to be tested; A feature extraction module is used to extract color features of all the images to be tested to obtain a color feature vector of each image to be tested; A feature dimensionality reduction module, configured to perform feature dimensionality reduction on the color feature vectors of all the to-be-tested images based on a preset principal component analysis method to obtain blood component data; A blood component prediction module, configured to perform blood component prediction on the color feature vectors and the blood component data through a preset particle swarm optimization algorithm to obtain a component prediction result; A drawing module, configured to draw a scatter plot according to the blood sample image and the component prediction result, and draw an error curve according to the component prediction result and the actual component information; A result generation module, configured to generate a blood component result graph according to the scatter plot and the error curve.

[0013] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the method for analyzing blood components based on a particle swarm optimization algorithm as described in the first aspect is implemented.

[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, storing computer-executable instructions for causing a computer to execute the method for analyzing blood components based on a particle swarm optimization algorithm as described in the first aspect.

[0015] The method for analyzing blood components based on a particle swarm optimization algorithm provided by the embodiments of the present application has at least the following beneficial effects: By obtaining a plurality of blood sample images and the actual component information corresponding to the blood sample images, and performing preprocessing operations on all the blood sample images to obtain a plurality of to-be-tested images, it is beneficial to improve the image quality. Then, color feature extraction is performed on all the to-be-tested images to obtain the color feature vectors of each to-be-tested image, improving the quality of the basic data of the system. Furthermore, feature dimensionality reduction is performed on the color feature vectors of all the to-be-tested images based on a preset principal component analysis method to obtain blood component data, which can effectively reduce the data dimension and calculation complexity and improve the calculation efficiency. By performing blood component prediction on the color feature vectors and the blood component data through a preset particle swarm optimization algorithm to obtain a component prediction result, the prediction process is further optimized, realizing the rapid prediction of blood components. After that, a scatter plot is drawn according to the blood sample image and the component prediction result, and an error curve is drawn according to the component prediction result and the actual component information, and a blood component result graph is generated according to the scatter plot and the error curve, which can intuitively display the prediction result for subsequent analysis and evaluation. The embodiments of the present application combine color feature extraction, principal component analysis, and a particle swarm optimization algorithm to realize the efficient analysis of blood sample images, thereby being beneficial to improving the efficiency and accuracy of blood component prediction.

[0016] Other features and advantages of the present application will be described in the subsequent specification, and in part will be obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the specification and the accompanying drawings. Description of the Drawings

[0017] The drawings are used to provide a further understanding of the technical solutions of the present application, and constitute a part of the specification. Together with the examples of the present application, they are used to explain the technical solutions of the present application, and do not constitute a limitation to the technical solutions of the present application.

[0018] Figure 1 is a flowchart of the specific method of the blood component analysis method based on the particle swarm optimization algorithm provided by an embodiment of the present application; Figure 2 is a specific flowchart of the blood component analysis method based on the particle swarm optimization algorithm provided by another embodiment of the present application; Figure 3 is a specific flowchart of the blood component analysis method based on the particle swarm optimization algorithm provided by another embodiment of the present application; Figure 4 is a specific flowchart of the blood component analysis method based on the particle swarm optimization algorithm provided by another embodiment of the present application; Figure 5 is a specific flowchart of the blood component analysis method based on the particle swarm optimization algorithm provided by another embodiment of the present application; Figure 6 is a specific flowchart of the blood component analysis method based on the particle swarm optimization algorithm provided by another embodiment of the present application; Figure 7 is a specific flowchart of the blood component analysis method based on the particle swarm optimization algorithm provided by another embodiment of the present application; Figure 8 is a block diagram of the structure of the blood component analysis system based on the particle swarm optimization algorithm provided by an embodiment of the present application; Figure 9 is a schematic diagram of the hardware structure of the electronic device provided by an embodiment of the present application. Detailed Embodiments

[0019] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0020] It should be noted that although functional modules are divided in the device schematic diagram and the logical sequence is shown in the flowchart, in some cases, the steps shown or described may be executed in a different module division from that in the device or a different sequence from that in the flowchart. The terms "first", "second", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing embodiments of this application and are not intended to limit this application.

[0022] A blood component analysis method based on the particle swarm algorithm provided by an embodiment of this application can be applied to a terminal, or to a server, or can also be software running on a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, etc.; the server can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms; the software can be an application that implements the above method, etc., but is not limited to the above forms.

[0023] Embodiments of this application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer computer devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and so on. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0024] With the growth of the public's demand for medical services and the need for rapid disease diagnosis, the accurate detection of blood components plays a crucial role in disease diagnosis, evaluation of treatment effects, and monitoring of daily health conditions.

[0025] In the prior art, blood component measurement usually relies on professional laboratory tests. However, there are many problems with such traditional detection methods in practical applications. On the one hand, the detection process requires blood sampling, which not only increases the pain and infection risk of patients but also makes it difficult to widely promote this detection method in civilian scenarios such as families and communities. On the other hand, the measurement time is relatively long. From sample collection, transportation, laboratory processing to the issuance of the final result, it often takes several hours or even several days, resulting in possible delays in the results and being unable to meet the urgent need for rapid monitoring in clinical and daily health monitoring. Especially in emergency medical situations or real-time health tracking, the deficiency of its timeliness is more prominent.

[0026] To solve the above problems, the embodiments of the present application provide a blood component analysis method, system, device, and medium based on the particle swarm optimization algorithm. By obtaining multiple blood sample images and the actual component information corresponding to the blood sample images, and performing preprocessing operations on all blood sample images to obtain multiple images to be measured, which is beneficial to improving the image quality. Then, color feature extraction is performed on all images to be measured to obtain the color feature vector of each image to be measured, improving the basic data quality of the system. Furthermore, based on the preset principal component analysis method, feature dimensionality reduction is performed on the color feature vectors of all images to be measured to obtain blood component data, which can effectively reduce the data dimension and computational complexity and improve the computational efficiency. Through the preset particle swarm optimization algorithm, blood component prediction is performed on the color feature vectors and blood component data to obtain the component prediction result, further optimizing the prediction process and realizing the rapid prediction of blood components. After that, a scatter plot is drawn based on the blood sample images and the component prediction results, and an error curve is drawn based on the component prediction results and the actual component information, and a blood component result graph is generated based on the scatter plot and the error curve, which can intuitively display the prediction results for subsequent analysis and evaluation. The embodiments of the present application combine color feature extraction, principal component analysis, and the particle swarm optimization algorithm to achieve efficient analysis of blood sample images, thereby facilitating the improvement of the efficiency and accuracy of blood component prediction.

[0027] Refer to Figure 1 , Figure 1 is the flowchart of the specific method of the blood component analysis method based on the particle swarm optimization algorithm provided by the embodiments of the present application. The method includes but is not limited to steps S100 to step S600.

[0028] Step S100: Obtain multiple blood sample images and the corresponding actual component information of the blood sample images, and perform preprocessing operations on all the blood sample images to obtain multiple images to be tested.

[0029] In step S100 of some embodiments, first collect multiple blood sample images and their corresponding actual component information, and perform preprocessing operations on these images, including grayscale conversion, denoising, and contrast enhancement, to improve the image quality and obtain multiple images to be tested. The blood sample images can be images containing blood component information obtained through a microscope or other imaging devices, and the actual component information corresponding to the blood sample images can be the true component data of the blood samples obtained through methods such as laboratory tests for subsequent comparison and evaluation. To obtain clear blood sample images, the blood sample images can be obtained by controlling a high-resolution camera. Specifically, according to the type of the camera and system requirements, a suitable hardware interface (such as USB, Wi-Fi, etc.) can be selected to connect the camera to ensure the stability and high speed of data transmission. Further, the camera can be initialized through software, such as setting basic parameters, such as resolution, exposure settings, focal length adjustment, and shooting angle control, to ensure that the camera is in a suitable working state. In one embodiment, the resolution of the camera can be selected as 1080P or 4K to ensure the clarity and details of the image, and the exposure time can be adjusted according to the characteristics of the blood sample to avoid overexposure or underexposure of the image and ensure the brightness and contrast of the image. Further, through the manual or automatic focusing function, ensure that the focal length of the camera is accurately aligned with the sample to obtain a clear image. In addition, the shooting angle of the camera can also be adjusted to ensure uniform illumination and the best viewing angle of the blood sample, reducing the influence of shadows and reflections. The setting of the basic parameters of the camera in the embodiments of the present application can be adjusted according to actual shooting requirements and is not limited thereto.

[0030] It should be noted that after taking multiple blood sample images through the camera, the image data can be transmitted to a computer for processing through a high-speed interface. The format of the image data may be common image formats such as BMP, PNG, JPEG, or RAW format, depending on the configuration of the camera and software. Further, perform preprocessing operations on all the blood sample images, such as grayscale conversion, denoising, enhancement, etc., to improve the image quality and obtain multiple images to be tested. Specifically, the denoising, segmentation, and color feature extraction of the blood sample images can be realized by calling professional image processing software, such as OpenCV.

[0031] Step S200: Extract color features from all the images to be tested to obtain the color feature vectors of each image to be tested.

[0032] In step S200 of some embodiments, after obtaining the images to be measured, color features of all the images to be measured can be extracted to generate color feature vectors, and color features of the blood samples (such as values in the RGB, HSV or Lab color spaces) can be extracted. Specifically, an image processing software such as OpenCV can be called to extract color features of the blood sample images. By selecting different color spaces, for example, when detecting the hemoglobin content in blood, hemoglobin presents specific red tones and saturations in the image. Selecting the RGB color space can directly extract the values of the red, green, and blue channels from the image, which is suitable for preliminary color analysis. Further, selecting the HSV color space can divide colors into hue, saturation, and value. By extracting the mean and variance of the hue and saturation in the HSV color space, hemoglobin samples with different concentrations can be effectively distinguished. In addition, in white blood cell classification, different types of white blood cells present different color and gray-scale characteristics under the microscope. Selecting the Lab color space can represent colors through three channels: lightness (L), green-red (a), and blue-yellow (b). By extracting color features in the Lab color space, cells in these blood samples can be more accurately identified and classified, improving the accuracy of diagnosis.

[0033] It should be noted that extracting color features also includes calculating features such as color histograms, means, variances, and color moments of each image to be measured in different color spaces. Specifically, the pixel distribution of each color channel can be calculated to generate a color histogram. The size of the histogram is usually 256 (pixel values from 0 to 255), and through normalization, the sum is made 1 to eliminate the influence of the image size. Also, the mean and variance of each color channel need to be calculated. The mean can reflect the average level of the color, and the variance can reflect the degree of dispersion of the color. Further, color moments such as the first-order moment (mean), second-order moment (variance), and third-order moment (skewness) can be calculated. Then, features such as color histograms, means, variances, and color moments in different color spaces are connected into a one-dimensional vector to form the color feature vector of the image to be measured.

[0034] Step S300: Based on the preset principal component analysis method, the color feature vectors of all the images to be measured are dimensionally reduced to obtain blood component data.

[0035] In step S300 of some embodiments, for the color feature vector of the image to be measured, a dimensionality reduction operation is performed by using the preset principal component analysis (PCA) to optimize the data structure. Specifically, the feature vector indicates the projection direction of the data in the principal component direction. By sorting the color feature vectors according to the magnitude of the eigenvalues, the color feature vectors corresponding to the first few largest eigenvalues can be selected as the principal components. Through PCA dimensionality reduction, the high-dimensional color data can be projected into the low-dimensional space composed of the principal components while retaining as much important information in the data as possible, obtaining blood component data, which helps to improve the calculation accuracy and speed.

[0036] Step S400: Predict the blood components using the preset particle swarm algorithm for the color feature vector and the blood component data to obtain a component prediction result.

[0037] In step S400 of some embodiments, the preset particle swarm algorithm can be an optimization algorithm based on swarm intelligence for blood component prediction. By using the established model to analyze new blood image samples, the color feature vector is input into the trained model to predict its blood components. Then, the result obtained by comparing and evaluating the blood component data predicted by the model with the actual component information is the component prediction result.

[0038] It should be noted that in the specific model training process, first, these color feature vectors are combined with the corresponding actual blood component data to form a training data set. Then, the preset particle swarm algorithm is used to train the model. During the training process, the particle swarm algorithm continuously adjusts the positions and velocities of the particles through error calculation, fitness evaluation, and parameter adjustment until the optimal model with the minimum error is found. It should be understood that the position of each particle represents a set of possible model parameters, and the velocity of the particle determines its moving direction and distance in the solution space. Then, by calculating the error (such as the mean square error) between the model prediction result and the actual blood component data, the fitness of each particle is evaluated. The smaller the fitness value, the closer the model parameters represented by the particle are to the optimal solution. After the model training is completed, new blood image samples can be used for blood component prediction. The new blood image samples are subjected to the same color feature extraction process to obtain color feature vectors, which are then input into the trained model to obtain a component prediction result. The optimization process of the particle swarm algorithm in the embodiments of the present application ensures the global optimality of the model parameters, improves the prediction accuracy and generalization ability of the model, and is faster and less costly compared with traditional blood component detection methods.

[0039] Step S500: Draw a scatter plot based on the blood sample image and the component prediction result, and draw an error curve based on the component prediction result and the actual component information.

[0040] In step S500 of some embodiments, for the blood sample image and the component prediction result, a scatter plot can be drawn by calling visualization software (such as Matplotlib) to show the component distribution of different blood samples. The predicted values and actual values can be distinguished by different colors, sizes or positions, intuitively showing the changes in blood components, which helps users quickly understand the overall trend and accuracy of the prediction results and judge whether the model has good prediction ability. Further, Matplotlib can also be used to draw the error curve of the component prediction result and the actual component information to show the error between the model predicted value and the actual value. The error curve usually uses indicators such as residual plots and root mean square error (RMSE) to help users identify sample points with large prediction errors and provide a basis for further model optimization.

[0041] Step S600: Generate a blood component result graph based on the scatter plot and the error curve.

[0042] In step S600 of some embodiments, after obtaining the scatter plot and the error curve, by calling visualization software (such as Matplotlib), the scatter plot and the error curve are integrated into a result graph to obtain a blood component result graph, which can be a heat map or other visualization form for showing the model prediction results, thereby helping users better understand the change trend of blood components and their relationship with image features.

[0043] Refer to Figure 2 , Figure 2 is the specific flowchart of step S100 provided by the embodiments of the present application for preprocessing all blood sample images to obtain multiple images to be tested. In some embodiments, the method includes but is not limited to steps S110 to S130.

[0044] Step S110: Denoise all blood sample images.

[0045] Step S120: Perform image segmentation on the denoised blood sample images through a preset image segmentation algorithm to obtain blood region images.

[0046] Step S130: Perform illumination equalization processing on the blood region images to obtain multiple images to be tested.

[0047] In some embodiments, during the denoising phase of all blood sample images in steps S110 to S130, all blood sample images are first processed using filters such as Gaussian filtering or median filtering. Gaussian filtering effectively removes Gaussian noise and is suitable for processing images affected by random noise, while median filtering excels at removing salt and pepper noise and is particularly suitable for processing images containing impulse noise. By appropriately selecting filters for denoising, interference introduced by suboptimal shooting environments or sensor noise can be significantly reduced.

[0048] It should be noted that after the noise interference is removed by the filter, image segmentation algorithms such as threshold segmentation, region growing or edge detection can be used, and the blood area can be accurately located based on the brightness, color or shape of the image, so as to accurately separate the blood area from the background. Specifically, threshold segmentation is suitable for images with obvious differences in grayscale distribution. By setting a suitable threshold, the target blood area and the background area can be quickly distinguished. Region growing starts from the seed point and gradually expands according to the preset growth rules. It is suitable for extracting blood areas with clear and coherent boundaries. Edge detection is to outline the boundaries of the blood area by identifying the edge contours with drastic grayscale changes in the image. During the segmentation process, morphological operations such as expansion and corrosion can also be combined to further optimize the segmentation boundaries, enhance the outline of the blood sample, and make the outline of the blood sample more complete and clear. Furthermore, the blood area image is subjected to illumination equalization processing to obtain multiple images to be tested. Light equalization processing adjusts the brightness and contrast of the image to make the overall light distribution of the image more uniform and the details of the blood area more prominent. For example, methods such as histogram equalization, adaptive histogram equalization, and contrast-limited adaptive histogram equalization can be used to obtain a test image with uniform light distribution, thereby providing a high-quality image data foundation for subsequent color feature extraction and blood component analysis.

[0049] Reference Figure 3 , Figure 3 This is a specific flow chart of step S200 of the embodiment of the present application, which extracts color features from all images to be tested to obtain a color feature vector for each image to be tested. In some embodiments, the method includes but is not limited to steps S210 to S250.

[0050] Step S210 : For each image to be tested, traverse all pixels of the image to be tested to determine color component information of each pixel.

[0051] Step S220 : For each preset channel, determine the channel average value of the image to be tested in the preset channel and the distribution of the image in the preset channel according to the color component information.

[0052] Step S230: Perform color conversion on the image to be measured based on color component information to obtain a color space image.

[0053] Step S240: Extract the hue information, saturation information, and brightness information of the color space image.

[0054] Step S250: Generate a color feature vector of the image to be measured according to the channel average value, distribution, hue information, saturation information, and brightness information.

[0055] In steps S210 to S250 of some embodiments, for each image to be measured, first traverse all pixel points of the image to be measured to determine the color component information of each pixel point. For example, in the RGB color space, each pixel point has three color component values: red (R), green (G), and blue (B). For each preset channel, the channel average value and distribution of the image to be measured under this channel can be determined according to the color component information. Specifically, the channel average value can be obtained by calculating the average value of all pixel points under this channel, and the distribution under the preset channel can be determined by generating a color histogram. Further, color conversion can be performed on the image to be measured based on the color component information to obtain a color space image. For example, an RGB image can be converted to the HSV color space to more intuitively extract hue, saturation, and brightness information. Then, in the HSV color space, the hue information, saturation information, and brightness information of the color space image are extracted. The hue information corresponds to the type of color, such as red, green, etc., and is represented as the H value in the HSV color space. The saturation information corresponds to the purity of the color, that is, the proportion of the gray component in the color, and is represented as the S value in the HSV color space. The brightness information corresponds to the brightness of the color, and is represented as the V value in the HSV color space. Finally, a color feature vector of the image to be measured is integrated according to the channel average value, distribution, hue information, saturation information, and brightness information, which can more accurately describe the color characteristics of the image to be measured and provide high-quality data support for blood component analysis. In one embodiment, an example of feature vector construction is as follows: ; where respectively represent the mean values of each channel of RGB and HSI, respectively represent the variances of each channel of RGB and HSI.

[0056] Refer to Figure 4 , Figure 4 which is a specific flowchart of step S300 provided by the embodiments of the present application for performing feature dimensionality reduction on the color feature vectors of all images to be measured based on the preset principal component analysis method to obtain blood component data. In some embodiments, the method includes but is not limited to steps S310 to S340.

[0057] Step S310: Perform data normalization on the color feature vectors of the image to be measured to obtain a data matrix.

[0058] Step S320: Calculate the covariance matrix of the data matrix, and perform eigenvalue decomposition on the covariance matrix to obtain the target feature vectors and the target eigenvalues corresponding to the target feature vectors.

[0059] Step S330: Sort the target feature vectors based on the target eigenvalues to screen out the principal component feature vectors with a preset ranking.

[0060] Step S340: Map the data matrix to the principal component feature vectors to obtain blood component data.

[0061] In steps S310 to S340 of some embodiments, the color feature vectors may include the means and variances of the red, green, and blue channels in the RGB color space, as well as the means and variances of the hue, saturation, and brightness in the HSV color space. Suppose the color feature vector of one of the three images to be measured obtained is , first perform data normalization on these color feature vectors to obtain a data matrix. Specifically, the mean and standard deviation of each color feature vector can be calculated. Among them, the mean calculation process can be: ; Among them, is the color feature vector of the image to be measured.

[0062] The standard deviation calculation process can be: ; Among them, is the color feature vector of the image to be measured, is the mean.

[0063] Furthermore, each eigenvalue is normalized, and the calculation process of the normalized value of the color feature vector is as follows: ; Among them, is the color feature vector of the image to be measured, is the mean, is the standard deviation.

[0064] Then, calculate the covariance matrix of the data matrix. For example, organize the color feature vectors of all the images to be measured after normalization into a data matrix: ; Furthermore, a covariance matrix is calculated using the data matrix. It should be understood that the size of the covariance matrix is the product of the number of features, and the covariance between two features is represented by each element in the covariance matrix. The calculation formula is as follows: ; where n is the number of samples, X and Y are two features, and μ X and μ Y are their means.

[0065] Moreover, by performing eigenvalue decomposition on the covariance matrix, target eigenvectors and target eigenvalues are obtained. The importance of the principal components is represented by the eigenvalues, and the directions of the principal components are represented by the eigenvectors. Further, based on the target eigenvalues, the target eigenvectors are sorted to screen out the principal component eigenvectors with a preset ranking. Specifically, the eigenvectors can be sorted according to the magnitudes of the eigenvalues, and the first few eigenvectors with the largest eigenvalues are selected as the principal component eigenvectors. For example, the top 3 principal component eigenvectors are screened out. Finally, the data matrix is mapped onto these 3 principal component eigenvectors to obtain blood component data for subsequent blood component analysis. It can be understood that through data standardization processing and principal component analysis of the color feature vector in the embodiments of the present application, the data dimension can be effectively reduced, the calculation efficiency can be improved, and the finally obtained blood component data is more concise, accurate, and reliable.

[0066] Referring to Figure 5 , Figure 5 is a specific flowchart of step S400 provided by the embodiments of the present application for predicting blood components using a preset particle swarm algorithm for the color feature vector and blood component data to obtain a component prediction result. In some embodiments, the method includes but is not limited to steps S410 to S460.

[0067] Step S410, set the initial particle swarm position and update the velocity.

[0068] Step S420, input the initial particle swarm position, color feature vector, and blood component data into a preset prediction model for fitness evaluation, and output a predicted value.

[0069] Step S430, calculate the prediction error value between the predicted value and the initial particle swarm position through a preset error function.

[0070] Step S440, adjust the initial particle swarm position and update the velocity according to the prediction error value, and record the current adjustment times and the update error value corresponding to the current adjustment times until the current adjustment times reach a preset iteration number or the update error value reaches a preset error value.

[0071] Step S450: adjusting the model parameters of the prediction model based on the updated error value to obtain a pre-trained prediction model.

[0072] Step S460: Input the color feature vector and blood component data into the pre-trained prediction model to perform blood component prediction, and output the component prediction result.

[0073] In some embodiments, in steps S410 to S460, the particle swarm position is first initialized and the update speed is set. The particle swarm position represents the initial parameters of the prediction model, and the update speed determines how the particles move in the solution space. The initialized particle swarm position, color feature vector, and blood component data are then input into a preset prediction model for fitness evaluation, and a predicted value is output. It should be understood that the preset prediction model may be a machine learning or deep learning model, and the fitness evaluation may be performed using an error function, which is not limited in this embodiment of the present application. Furthermore, the preset error function may employ the mean squared error (MSE) as an error function to calculate the error between the predicted value and the initialized particle swarm position. During the process of adjusting the initialized particle swarm position and the update speed based on the predicted error value, the current number of adjustments and the corresponding updated error value are recorded. This process is repeated until the current number of adjustments reaches a preset number of iterations or the updated error value reaches a preset error value, where the preset error value may be a preset threshold. The model parameters of the prediction model are then adjusted based on the updated error value to obtain a pre-trained prediction model. Finally, the newly acquired color feature vector and blood component data are input into the pre-trained prediction model to perform blood component prediction and output the final component prediction result. It should be noted that the embodiment of the present application effectively adjusts the parameters of the prediction model through the particle swarm optimization algorithm, thereby improving the prediction accuracy of the model.

[0074] Reference Figure 6 , Figure 6 This is a specific flow chart of drawing a scatter plot based on the blood sample image and the component prediction result in step S500 provided in an embodiment of the present application. In some embodiments, the method includes but is not limited to steps S510 to S530.

[0075] Step S510 , classifying the blood sample image to obtain multiple blood sample types.

[0076] Step S520 , determining the predicted hemoglobin concentration, predicted white blood cell count, and predicted hematocrit corresponding to each blood sample type according to the component prediction results.

[0077] Step S530 : Draw a first scatter plot based on the blood sample type and the predicted hemoglobin concentration, draw a second scatter plot based on the blood sample type and the predicted white blood cell count, and draw a third scatter plot based on the blood sample type and the predicted hematocrit.

[0078] In steps S510 to S530 of some embodiments, the blood sample images are first classified to obtain multiple blood sample types, which can be specifically implemented by manual classification or automatic classification using an image recognition algorithm. For example, classification can be performed according to the source, color characteristics, or other morphological characteristics of the blood samples, and the embodiments of the present application do not limit this. Further, the predicted hemoglobin concentration, predicted white blood cell count, and predicted hematocrit corresponding to each blood sample type are determined according to the component prediction results. Specifically, a pre-trained prediction model is used, which can output the corresponding blood component prediction results according to the color feature vector of the input blood sample image and other relevant data. Further, a first scatter plot is drawn according to the blood sample type and the predicted hemoglobin concentration. Specifically, in the scatter plot, the horizontal axis represents the blood sample type, the vertical axis represents the predicted hemoglobin concentration, and each point represents a blood sample, and its position is determined by the sample type and the corresponding predicted concentration value. Similarly, a second scatter plot is drawn according to the blood sample type and the predicted white blood cell count, and a third scatter plot is drawn according to the blood sample type and the predicted hematocrit.

[0079] It should be noted that the predicted blood component data (such as hemoglobin concentration, white blood cell count, hematocrit, etc.) can be displayed to the user in real time through a graphical user interface (GUI). The display content can include forms such as numerical values, icons, or dashboards. The user interface can display the accuracy and reliability of the model prediction through visual elements (such as progress bars, numerical value changes, etc.). By classifying the blood sample images and drawing scatter plots, the component prediction results of different types of blood samples can be intuitively displayed, which helps researchers and clinicians quickly understand the prediction results of each blood component.

[0080] In some embodiments, the actual component information includes multiple sub-component information, and the component prediction results include sub-prediction results corresponding one-to-one to the sub-component information. It can be understood that the real component data of the blood sample obtained by methods such as laboratory testing is the actual component information, and the specific component data in the actual component information includes multiple sub-component information, such as hemoglobin concentration, white blood cell count, hematocrit, etc. Further, the blood component data obtained through the prediction model is the component prediction result, including sub-prediction results corresponding one-to-one to the sub-component information. For example, it can be the predicted values corresponding to each sub-component information in the component prediction result.

[0081] Refer to Figure 7 , Figure 7 is the specific flowchart of drawing an error curve according to the component prediction result and the actual component information in step S500 provided by an embodiment of the present application. In some embodiments, the method includes but is not limited to steps S540 to S560.

[0082] Step S540: Record the index values of each sub-prediction result.

[0083] Step S550: For each sub-component information, calculate the data error value between the sub-component information and the corresponding sub-prediction result.

[0084] Step S560: Draw an error curve based on the index values and the data error values.

[0085] In steps S540 to S560 of some embodiments, each sub-component information in the actual component information is recorded, which may specifically include: hemoglobin concentration (g / dL), white blood cell count (cells / μL), and hematocrit (%). Then, using the trained prediction model, each blood sample is analyzed to obtain the component prediction results. Each prediction result includes sub-prediction results corresponding one-to-one to the above sub-component information, which may specifically include: predicted hemoglobin concentration (g / dL), predicted white blood cell count (cells / μL), and predicted hematocrit (%). Moreover, a unique index value is assigned to each sub-prediction result. For example: index value 1: hemoglobin concentration, index value 2: white blood cell count, index value 3: hematocrit. Further, the data error value between each sub-component information and the corresponding sub-prediction result is calculated. For example, the mean squared error (MSE) is used for calculation: ; where, is the actual value, is the predicted value, and n is the number of samples.

[0086] It should be noted that an error curve is drawn based on the index values and the data error values. For example, the horizontal axis can represent the index values, and the vertical axis can represent the data error values. Through the error curve, the changing trend of the prediction errors of different sub-components can be intuitively seen, which helps users evaluate the prediction performance of the model.

[0087] Next, in combination with Figure 8 describe the blood component analysis system 800 based on the particle swarm optimization algorithm provided in the second aspect of the present application. Figure 8 FIG. shows a schematic structural block diagram of the blood component analysis system 800 based on the particle swarm optimization algorithm according to an embodiment of the present application. As Figure 8As shown in the figure, the system includes a data acquisition module 810, a feature extraction module 820, a feature dimensionality reduction module 830, a blood component prediction module 840, a drawing module 850, and a result generation module 860. Among them, the data acquisition module is used to acquire multiple blood sample images and the actual component information corresponding to the blood sample images, and perform preprocessing operations on all the blood sample images to obtain multiple images to be tested; the feature extraction module is used to extract color features from all the images to be tested to obtain the color feature vectors of each image to be tested; the feature dimensionality reduction module is used to perform feature dimensionality reduction on the color feature vectors of all the images to be tested based on the preset principal component analysis method to obtain blood component data; the blood component prediction module is used to perform blood component prediction on the color feature vectors and the blood component data through the preset particle swarm algorithm to obtain a component prediction result; the drawing module is used to draw a scatter plot according to the blood sample images and the component prediction result, and draw an error curve according to the component prediction result and the actual component information; the result generation module is used to generate a blood component result map according to the scatter plot and the error curve.

[0088] The blood component analysis system based on the particle swarm algorithm according to the embodiment of the present application can be used to execute the blood component analysis method based on the particle swarm algorithm according to the embodiment of the present application described above. Those skilled in the art can understand the structure and its operation of the blood component analysis system based on the particle swarm algorithm in combination with the description of the blood component analysis method based on the particle swarm algorithm according to the embodiment of the present application above, and will not be elaborated here.

[0089] The embodiment of the present application also provides an electronic device, including a memory and a processor. Among them, a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is used to execute the blood component analysis method based on the particle swarm algorithm in the above embodiment of the present application.

[0090] Please refer to Figure 9 , Figure 9 which schematically shows the hardware structure of the electronic device provided by the embodiment of the present application. The electronic device includes: A processor 901, which can be implemented by using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solution provided by the embodiment of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the blood component analysis method based on the particle swarm algorithm in the embodiments of this application. Input / output interface 903, used to implement information input and output; Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.); Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 ); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0091] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned blood component analysis method based on the particle swarm algorithm.

[0092] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0093] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0094] It will be understood by those skilled in the art that Figures 1 - 9The technical solutions shown do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown, or combine certain steps, or different steps.

[0095] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0096] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and their appropriate combinations.

[0097] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0098] It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally means that the associated objects before and after are in an "or" relationship. "At least one (one) of the following" or its similar expressions refer to any combination of these items, including any combination of single item (one) or plural items (ones). For example, at least one (one) of a, b, or c may mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0099] In several embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of systems or units can be in electrical, mechanical or other forms.

[0100] The units described above as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0101] In addition, in each embodiment of the present application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0102] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs that can store programs.

[0103] The preferred embodiments of the embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the rights of the embodiments of the present application. Any modifications, equivalent replacements, and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the rights of the embodiments of the present application.

Claims

1. A blood component analysis method based on the particle swarm optimization algorithm, characterized in that, The method includes: Obtaining a plurality of blood sample images and actual component information corresponding to the blood sample images, and performing a preprocessing operation on all the blood sample images to obtain a plurality of images to be tested; Performing color feature extraction on all the images to be tested to obtain a color feature vector of each image to be tested; Performing feature dimensionality reduction on the color feature vectors of all the images to be tested based on a preset principal component analysis method to obtain blood component data; Performing blood component prediction on the color feature vector and the blood component data through a preset particle swarm algorithm to obtain a component prediction result; Drawing a scatter plot according to the blood sample image and the component prediction result, and drawing an error curve according to the component prediction result and the actual component information; Generating a blood component result graph according to the scatter plot and the error curve.

2. The method for analyzing blood components based on the particle swarm algorithm according to claim 1, characterized in that, The performing a preprocessing operation on all the blood sample images to obtain a plurality of images to be tested includes: Performing a denoising operation on all the blood sample images; Performing image segmentation on the denoised blood sample images through a preset image segmentation algorithm to obtain blood region images; Performing illumination equalization processing on the blood region images to obtain a plurality of images to be tested.

3. The method for analyzing blood components based on the particle swarm optimization algorithm according to claim 1, characterized in that The performing color feature extraction on all the images to be tested to obtain a color feature vector of each image to be tested includes: For each image to be tested, traversing all pixel points of the image to be tested to determine color component information of each pixel point; For each preset channel, determining a channel average value of the image to be tested under the preset channel and a distribution condition under the preset channel according to the color component information; Performing color conversion on the image to be tested based on the color component information to obtain a color space image; Extracting hue information, saturation information, and brightness information of the color space image; Generating a color feature vector of the image to be tested according to the channel average value, the distribution condition, the hue information, the saturation information, and the brightness information.

4. The method for analyzing blood components based on the particle swarm algorithm according to claim 1, characterized in that The performing feature dimensionality reduction on the color feature vectors of all the images to be tested based on a preset principal component analysis method to obtain blood component data includes: Performing data standardization processing on the color feature vectors of the images to be tested to obtain a data matrix; Calculating a covariance matrix of the data matrix, and performing eigenvalue decomposition on the covariance matrix to obtain a target feature vector and a target eigenvalue corresponding to the target feature vector; Sorting the target feature vector based on the target eigenvalue to screen out principal component feature vectors with a preset ranking; Mapping the data matrix to the principal component feature vector to obtain blood component data.

5. The blood component analysis method based on the particle swarm algorithm according to claim 1, characterized in that, The performing blood component prediction on the color feature vector and the blood component data through a preset particle swarm algorithm to obtain a component prediction result includes: Setting an initial particle swarm position and an update speed; Inputting the initial particle swarm position, the color feature vector, and the blood component data into a preset prediction model for fitness evaluation, and outputting a predicted value; Calculate the prediction error value between the predicted value and the initialized particle swarm position through a preset error function; Adjust the initialized particle swarm position and the updated velocity according to the prediction error value, and record the current adjustment times and the updated error value corresponding to the current adjustment times until the current adjustment times reach the preset iteration times or the updated error value reaches the preset error value; Adjust the model parameters of the prediction model based on the updated error value to obtain a pre-trained prediction model; Input the color feature vector and the blood component data into the pre-trained prediction model for blood component prediction, and output the component prediction result.

6. The method for analyzing blood components based on the particle swarm algorithm according to claim 1, wherein, The drawing of the scatter plot according to the blood sample image and the component prediction result includes: Classify the blood sample images to obtain multiple blood sample types; Determine the predicted hemoglobin concentration, predicted white blood cell count, and predicted hematocrit corresponding to each blood sample type according to the component prediction result; Draw a first scatter plot according to the blood sample type and the predicted hemoglobin concentration, draw a second scatter plot according to the blood sample type and the predicted white blood cell count, and draw a third scatter plot according to the blood sample type and the predicted hematocrit.

7. The method for analyzing blood components based on the particle swarm algorithm according to claim 1, wherein The actual component information includes multiple sub-component information, and the component prediction result includes sub-prediction results corresponding one by one to the sub-component information; the drawing of the error curve according to the component prediction result and the actual component information includes: Record the index value of each sub-prediction result; For each sub-component information, calculate the data error value between the sub-component information and the sub-prediction result corresponding to the sub-component information; Draw an error curve based on the index value and the data error value.

8. A blood component analysis system based on a particle swarm optimization algorithm, characterized in that, The system includes: A data acquisition module for acquiring multiple blood sample images and the actual component information corresponding to the blood sample images, and performing preprocessing operations on all the blood sample images to obtain multiple images to be tested; A feature extraction module for extracting color features from all the images to be tested to obtain the color feature vector of each image to be tested; A feature dimensionality reduction module for performing feature dimensionality reduction on the color feature vectors of all the images to be tested based on a preset principal component analysis method to obtain blood component data; A blood component prediction module for performing blood component prediction on the color feature vector and the blood component data through a preset particle swarm algorithm to obtain a component prediction result; A drawing module for drawing a scatter plot according to the blood sample image and the component prediction result, and drawing an error curve according to the component prediction result and the actual component information; A result generation module for generating a blood component result graph according to the scatter plot and the error curve.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, it implements the blood component analysis method based on the particle swarm algorithm according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to execute the blood component analysis method based on the particle swarm algorithm according to any one of claims 1 to 7.