A serum state recognition method, device, equipment and storage medium

By combining machine vision and deep learning technologies with target detection and image classification models, the problem of low efficiency in serum status detection has been solved, achieving accurate identification of serum status, avoiding sampling needle blockage, and improving detection efficiency and accuracy.

CN116109871BActive Publication Date: 2026-04-21AUTOBIO DIAGNOSTICS CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
AUTOBIO DIAGNOSTICS CO LTD
Filing Date
2023-02-21
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Current technologies for serum status detection are inefficient, leading to frequent clogging of sampling needles and affecting detection accuracy and cycle time.

Method used

This study employs a combination of machine vision and deep learning. By acquiring images of blood collection tubes, target detection and segmentation algorithms are used to identify whole blood regions. An improved ResNet50 network structure is then used for serum status identification, including grayscale processing, smoothing filtering, threshold calculation, and image classification.

Benefits of technology

It achieves accurate identification of serum status, avoids sampling needle blockage, improves detection efficiency and accuracy, and is compatible with various sizes of blood collection tubes and blood collection tubes containing separation gel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116109871B_ABST
    Figure CN116109871B_ABST
Patent Text Reader

Abstract

The application discloses a serum state recognition method, device and equipment and a storage medium, and is applied to the medical detection field, and comprises the following steps: acquiring a blood collection tube image containing serum and taking the blood collection tube image as a sample image; detecting the sample image by using a target detection algorithm to obtain a whole blood region image; segmenting the whole blood region image by using a segmentation algorithm to obtain a serum region image; preprocessing the serum region image to obtain a preprocessed serum region image, wherein the preprocessing comprises compression processing; and recognizing the preprocessed serum region image by using an improved Resnet50 network structure image classification model to determine the serum state. According to the application, the serum state in the blood collection tube can be accurately recognized by combining the machine vision and the deep learning technology, the serum state can be accurately recognized before a sampling needle sucks the serum, the serum state sample with an abnormal state can be filtered, and the problem of needle blockage of the sampling needle can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical testing, and in particular to a method, apparatus, device, and storage medium for serum status identification. Background Technology

[0002] In the operation of a fully automated medical biochemical and immunoassay testing line, each blood sample after centrifugation needs to have a certain amount of serum drawn through a sampling needle for various biochemical and immunoassay tests. Improper blood sample handling can lead to the presence of fibrin strands or blood clots in the serum (the pale yellow, transparent liquid that separates from the blood after coagulation). This can cause needle blockage or partial blockage when the sampling needle draws up the serum. Blockage requires professional intervention, increasing the overall testing cycle and cost. Partial blockage results in insufficient serum volume for the required biochemical tests, leading to inaccurate results. Therefore, the sampling needle must accurately identify the serum state before drawing up serum and filter out samples with abnormal serum states to avoid needle blockage.

[0003] The commonly used method is to manually detect serum status, which requires professionals to judge each centrifuged sample based on experience. This method is highly subjective, requires a high level of experience, and is labor-intensive. MTS (Mahalanobis-Taguchi System) detection can also be performed, but this method triggers an alarm when needle blockage has already occurred, requiring professional intervention and making it impossible to completely prevent needle blockage. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a serum status identification method, device, equipment and storage medium, which solves the problem of low efficiency in serum status detection in the prior art.

[0005] To address the aforementioned technical problems, this invention provides a serum status identification method, comprising:

[0006] Acquire images of blood collection tubes filled with serum and use them as sample images;

[0007] The sample image is detected using a target detection algorithm to obtain a whole blood region image;

[0008] The whole blood region image is segmented using a segmentation algorithm to obtain a serum region image;

[0009] The serum region image is preprocessed to obtain a preprocessed serum region image, the preprocessing including compression.

[0010] An improved ResNet50 network structure image classification model is used to identify the preprocessed serum region image and determine the serum status.

[0011] Optionally, the step of segmenting the whole blood region image using a segmentation algorithm to obtain a serum region image includes:

[0012] The whole blood region image is converted to grayscale to obtain a grayscale image;

[0013] The grayscale image is smoothed using a Gaussian filter to obtain a smoothed image.

[0014] Calculate the image histogram of the smoothed image, and determine the threshold based on the valleys of the image histogram;

[0015] The smoothed image is binarized and subjected to morphological opening operations using the threshold to obtain a binarized image;

[0016] Calculate the bounding rectangle corresponding to the largest area in the binarized image to obtain the upper boundary value of the blood clot region;

[0017] The truncated interval is determined based on the upper boundary value of the blood clot region, and the whole blood region image is truncated based on the truncated interval to obtain the serum region image.

[0018] Optionally, calculating the image histogram of the smoothed image and determining a threshold based on the troughs of the image histogram includes:

[0019] The number of pixels corresponding to each gray value in the image histogram is counted to obtain a statistical value array;

[0020] Calculate the difference between adjacent values ​​in the statistical value array, and determine the fluctuation point based on the difference;

[0021] The fluctuation points are filtered to obtain the first array;

[0022] The first peak information, the first trough information, the second peak information, and the second trough information are calculated based on the first array. The first peak information includes the gray value and statistical value corresponding to the first peak. The first trough information includes the gray value and statistical value corresponding to the first trough. The second peak information includes the gray value and statistical value corresponding to the second peak. The second trough information includes the gray value and statistical value corresponding to the second trough.

[0023] When the ratio of the statistical value corresponding to the second peak to the statistical value corresponding to the first peak is greater than the first preset value, or when the difference between the gray value corresponding to the first trough and the gray value corresponding to the first peak is less than the second preset value, the gray value corresponding to the second trough is the threshold value; otherwise, the gray value corresponding to the first trough is the threshold value.

[0024] Optionally, the preprocessing of the serum region image to obtain a preprocessed serum region image includes compression processing, comprising:

[0025] The serum region image is processed using an automatic contrast algorithm to obtain a first image.

[0026] The first image is compressed without deformation to obtain the preprocessed serum region image.

[0027] Optionally, the step of using an improved ResNet50 network structure image classification model to identify the preprocessed serum region image and determine the serum status includes:

[0028] The improved ResNet50 network structure image classification model includes two residual modules in each of the first, second, third, and fourth stages, and each residual module includes an attention mechanism module.

[0029] The improved ResNet50 network structure image classification model is used to identify the serum region image, and the identification result is determined.

[0030] Optionally, the improved ResNet50 network structure image classification model further includes:

[0031] The outputs of the second, third, and fourth stages of the improved ResNet50 network structure image classification model are concatenated after passing through an adaptive average pooling layer, and the concatenated output is connected to a fully connected layer.

[0032] Optionally, the step of using a target detection algorithm to detect the sample image to obtain a whole blood region image includes:

[0033] The sample image was detected using the YOLOv5s object detection model to obtain the whole blood region image.

[0034] The present invention also provides a serum status identification device, comprising:

[0035] The acquisition module is used to acquire images of blood collection tubes containing serum and use them as sample images;

[0036] The target detection module is used to detect the sample image using a target detection algorithm to obtain a whole blood region image;

[0037] The region segmentation module is used to segment the whole blood region image using a segmentation algorithm to obtain a serum region image;

[0038] The preprocessing module is used to preprocess the serum region image to obtain a preprocessed serum region image, wherein the preprocessing includes compression processing;

[0039] The image recognition module is used to identify the preprocessed serum region image using an improved ResNet50 network structure image classification model to determine the serum status.

[0040] The present invention also provides a serum status identification device, comprising:

[0041] Memory, used to store computer programs;

[0042] A processor is used to implement the steps of the serum status identification method described above when executing the computer program.

[0043] The present invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the serum status identification method described above.

[0044] As can be seen, this invention acquires an image of a blood collection tube containing serum as a sample image; uses a target detection algorithm to detect the sample image to obtain a whole blood region image; uses a segmentation algorithm to segment the whole blood region image to obtain a serum region image; preprocesses the serum region image to obtain a preprocessed serum region image, including compression; and uses an improved ResNet50 network structure image classification model to identify the preprocessed serum region image and determine the serum state. This invention uses a combination of machine vision and deep learning technology to accurately identify the serum state in blood collection tubes. It can accurately identify the serum state before the sampling needle draws serum, filter abnormal serum samples, avoid needle clogging, and is compatible with various sizes of blood collection tubes and blood collection tubes containing separating gel. It can accurately identify abnormal states such as fibrin filaments and blood clots in the serum of blood collection tubes.

[0045] In addition, the present invention also provides a serum status identification device, equipment and storage medium, which also have the above-mentioned beneficial effects. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0047] Figure 1 A flowchart of a serum status identification method provided in an embodiment of the present invention;

[0048] Figure 2 An example diagram of a serum status classification model provided in an embodiment of the present invention;

[0049] Figure 3 An example diagram of a residual module and an attention mechanism module provided in an embodiment of the present invention;

[0050] Figure 4 This is a schematic diagram of the structure of a serum status identification device provided in an embodiment of the present invention;

[0051] Figure 5 This is a schematic diagram of the structure of a serum status identification device provided in an embodiment of the present invention. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0053] Please refer to Figure 1 , Figure 1 A flowchart illustrating a serum status identification method provided in an embodiment of the present invention. The method may include:

[0054] S101: Acquire an image of a blood collection tube filled with serum and use it as a sample image.

[0055] The execution subject in this embodiment is a terminal. This embodiment does not limit the type of terminal, as long as it can perform the serum status identification operation. For example, the terminal can be a dedicated terminal; or it can be a general-purpose terminal. This embodiment does not limit the method of acquiring the image of the blood collection tube containing serum. For example, an industrial camera can be used to photograph the blood collection tube containing serum to obtain a video stream, and the image with a clear shooting effect can be extracted from the video stream; or a camera can be used to photograph the blood collection tube containing serum to obtain an image. This embodiment can use an industrial camera to photograph and acquire images of centrifuged blood samples to obtain images of blood collection tubes containing serum, and use these images to identify abnormal states in the serum such as fibrin threads and blood clots.

[0056] S102: Use an object detection algorithm to detect the sample image and obtain the whole blood region image.

[0057] This embodiment does not limit the specific object detection algorithm, as long as it can achieve object detection. For example, the object detection algorithm can be the YOLOv5s object detection algorithm; or the object detection algorithm can also be the YOLOv4 object detection algorithm.

[0058] Furthermore, to ensure the effectiveness of target detection, the above-mentioned target detection algorithm is used to detect the sample image to obtain the whole blood region image, which may include the following steps:

[0059] The YOLOv5s object detection model was used to detect the sample images to obtain whole blood region images.

[0060] This embodiment uses the YOLOv5s (an object detection algorithm model) to detect whole blood regions in blood collection tubes. This embodiment does not limit the specific settings of the YOLOv5s object detection algorithm; for example, the Adam optimizer (adaptive moment estimator) can be used, with an initial learning rate of 0.001, 100 training iterations, and a test set of 0.996map@0.5 (map@0.5: Iou = 0.5 (Iou: Intersection over Union, a metric for measuring the accuracy of object detection in a specific dataset)) to calculate the average precision (ap) for all images in each category. It is understood that before training the object detection model, it is necessary to collect a sample dataset. This technique uses the LabelImg (image annotation tool) to annotate the collected serum sample images, and can randomly divide them into training, validation, and test sets in a 7:2:1 ratio for model training to obtain optimal model parameters. Once the object detection model is trained, it can be used to detect objects in sample images to obtain whole blood region images.

[0061] S103: Use a segmentation algorithm to segment the whole blood region image to obtain the serum region image.

[0062] In this embodiment, the whole blood region includes an upper serum region, a lower blood clot region, and, when the blood collection tube is a separating gel blood collection tube, an intermediate separating gel region. This embodiment does not limit the specific segmentation algorithm, as long as it can achieve image segmentation. This embodiment does not limit the specific segmentation processing procedure. For example, a segmentation algorithm can be directly used to segment the whole blood region image; or the whole blood region image can be smoothed to grayscale before using a segmentation algorithm.

[0063] Furthermore, in order to more effectively segment the whole blood region image and extract the serum region image, the above-mentioned segmentation algorithm for segmenting the whole blood region image to obtain the serum region image may include the following steps:

[0064] Step 21: Perform grayscale processing on the whole blood region image to obtain a grayscale image;

[0065] Step 22: Smooth the grayscale image using Gaussian filtering to obtain a smoothed image;

[0066] Step 23: Calculate the image histogram of the smoothed image, and determine the threshold based on the valleys of the image histogram;

[0067] Step 24: Perform binarization and morphological opening operations on the smoothed image using a threshold to obtain a binarized image;

[0068] Step 25: Calculate the bounding rectangle corresponding to the largest area in the binarized image to obtain the upper boundary value of the blood clot region;

[0069] Step 26: Determine the cut-off interval based on the upper boundary value of the blood clot region, and cut off the whole blood region image according to the cut-off interval to obtain the serum region image.

[0070] This embodiment performs grayscale processing on the whole blood region image and further smooths it using Gaussian filtering. The image histogram of the grayscale and smoothed image is calculated. A threshold is determined based on the grayscale values ​​corresponding to the troughs of the image histogram. This threshold is then used to perform binarization and morphological opening operations on the smoothed image to obtain a binarized image. The bounding rectangle corresponding to the largest area in this binarized image is calculated to determine the upper boundary value of the blood clot region. Based on this upper boundary value, a cropping interval is set to obtain the cropped region, thus obtaining the serum region image. This embodiment does not limit the cropping interval. For example, the cropped region can be obtained by floating 100 pixels down from the upper boundary value; or the cropping interval can also be obtained by floating 50 pixels down from the upper boundary value. This embodiment does not limit the specific method for determining the threshold. For example, the gray value corresponding to the first trough of the image histogram can be determined as the threshold; or the fluctuation points of the image histogram can be filtered, and the first effective trough can be determined by the first trough, the first peak, the second peak and the second trough, and the gray value corresponding to the first effective trough can be used as the threshold.

[0071] Furthermore, to improve the accuracy of the segmentation threshold and the overall image segmentation accuracy, the above-mentioned calculation of the image histogram of the smoothed image, and the determination of the threshold based on the valleys of the image histogram, may include the following steps:

[0072] Step 31: Count the number of pixels corresponding to each gray value in the image histogram to obtain a statistical value array;

[0073] Step 32: Calculate the difference between adjacent values ​​in the statistical value array, and determine the fluctuation point based on the difference;

[0074] Step 33: Filter the fluctuation points to obtain the first array;

[0075] Step 34: Calculate the first peak information, the first trough information, the second peak information, and the second trough information based on the first array. The first peak information includes the gray value and statistical value corresponding to the first peak. The first trough information includes the gray value and statistical value corresponding to the first trough. The second peak information includes the gray value and statistical value corresponding to the second peak. The second trough information includes the gray value and statistical value corresponding to the second trough.

[0076] Step 35: When the ratio of the statistical value corresponding to the second peak to the statistical value corresponding to the first peak is greater than the first preset value or the difference between the gray value corresponding to the first trough and the gray value corresponding to the first peak is less than the second preset value, then the gray value corresponding to the second trough is the threshold; otherwise, the gray value corresponding to the first trough is the threshold.

[0077] In this embodiment, a statistical value array is obtained by counting the number of pixels corresponding to each grayscale value in the image histogram. The difference between adjacent values ​​in the statistical value array is calculated, i.e., the difference with the preceding adjacent value. Fluctuation points are determined based on these differences, and these fluctuation points are filtered to obtain a first array. Based on the first array, grayscale values ​​and statistical values ​​corresponding to two troughs and two peaks are calculated. When the ratio of the statistical value corresponding to the second peak to the statistical value corresponding to the first peak is greater than a first preset value, or the difference between the grayscale value corresponding to the first trough and the grayscale value corresponding to the first peak is less than a second preset value, then the grayscale value corresponding to the second trough is a threshold value; otherwise, the grayscale value corresponding to the first trough is a threshold value. This embodiment does not limit the number of differences between adjacent values ​​in the statistical value array. For example, only the differences between adjacent values ​​in the statistical value array corresponding to the first 128 grayscale values ​​can be calculated; or the differences between adjacent values ​​in the statistical value array corresponding to all 256 grayscale values ​​can also be calculated. This embodiment does not limit the first and second preset values; users can set them according to actual conditions.

[0078] To better understand the process of determining the segmentation threshold, the following example is used: The first stage is the statistical value array of the image histogram; the second stage is the difference between adjacent values ​​in the first 128 statistical values; the third stage is the difference after filtering out fluctuation points. The filtering process is that when a value with an opposite sign suddenly exists in a range, the value with the opposite sign is set to a value with the same sign as the value in that range. For example, {-2177, -615, -465, 31, -1015, -598} is filtered to {-2177, -615, -465, -1, -1015, -598}; {4, 4, -8, 28, 23, 142} is filtered to {4, 4, 1, 28, 23, 142}; the fourth stage is the grayscale values ​​corresponding to the first peak, the first trough, the second peak, and the second trough obtained from the data after filtering out fluctuation points.

[0079] S104: Preprocess the serum region image to obtain a preprocessed serum region image. The preprocessing includes compression.

[0080] This embodiment performs preprocessing operations, including compression, on serum region images to obtain images suitable for subsequent classification models. This embodiment does not limit the specific content of the preprocessing operations. For example, preprocessing may only include compression; or preprocessing may also include detail processing and non-variable size compression.

[0081] Furthermore, to improve recognition accuracy, the serum region image is preprocessed to obtain a preprocessed serum region image. Preprocessing includes compression and may include the following steps:

[0082] Step 41: Use an automatic contrast algorithm to perform detail processing on the serum region image to obtain the first image;

[0083] Step 42: Perform non-variable size compression on the first image to obtain a preprocessed serum region image.

[0084] In this embodiment, an automatic contrast algorithm is used to enhance the details of the serum region, and then the image is subjected to non-variable size compression processing to obtain an image with a size of 240x464.

[0085] S105: The improved ResNet50 network structure image classification model is used to identify the preprocessed serum region image and determine the serum status.

[0086] The ResNet50 network architecture is a classic image classification model. This embodiment uses an improved ResNet50 network architecture (Residual Neural Network) image classification model to identify preprocessed serum region images. The image classification model is trained using transfer learning. The parameters of the new model are initialized using a pre-trained improved ResNet50 network architecture model on the ImageNet dataset (a public dataset), thus obtaining a trained image classification model. This model is then used to identify preprocessed serum region images and determine the serum status.

[0087] Furthermore, to ensure recognition accuracy while accelerating model inference, the above-mentioned image classification model using an improved ResNet50 network structure to identify preprocessed serum region images and determine serum status may include the following steps:

[0088] Step 51: The improved ResNet50 network structure image classification model includes two residual modules in each of the first, second, third and fourth stages, and the residual modules include attention mechanism modules.

[0089] Step 52: Use the improved ResNet50 network structure image classification model to identify the serum region image and determine the identification result.

[0090] Furthermore, to increase low-dimensional feature information and improve classification accuracy, the improved ResNet50 network structure image classification model described above may also include the following steps:

[0091] The outputs of the second, third, and fourth stages of the improved ResNet50 network structure image classification model are concatenated through adaptive average pooling layers, and the concatenated outputs are then connected to fully connected layers.

[0092] To better understand the serum status classification process, please refer to... Figure 2 and Figure 3 , Figure 2 An example diagram of a serum status classification model provided in an embodiment of the present invention. Figure 3 This is an example diagram of a residual module and an attention mechanism module provided in an embodiment of the present invention.

[0093] The serum state identification method provided in this invention involves acquiring an image of a blood collection tube containing serum, which is then used as a sample image. A target detection algorithm is used to detect the sample image, resulting in a whole blood region image. A segmentation algorithm is then used to segment the whole blood region image, resulting in a serum region image. The serum region image is preprocessed, including compression. Finally, an improved ResNet50 network structure image classification model is used to identify the preprocessed serum region image and determine the serum state. This invention uses a combination of machine vision and deep learning to accurately identify the serum state in blood collection tubes. It enables accurate identification of serum state before the sampling needle draws serum, filtering out abnormal serum samples and preventing needle blockage. It is also compatible with various sizes of blood collection tubes and those containing separating gels, and can accurately identify abnormal states such as fibrin threads and blood clots in the serum collected from the tubes. Furthermore, the YOLOv5s object detection model ensures effective object detection. A series of processing steps on the whole blood region image enables more effective segmentation. Thresholds are calculated by filtering fluctuation points, improving the segmentation threshold and image segmentation accuracy. Detail processing and non-variable size compression of the serum region image enhance recognition accuracy. Each stage of the classification model includes two residual modules, each containing an attention mechanism, ensuring recognition accuracy while accelerating model inference. The outputs of the second, third, and fourth stages of the improved ResNet50 network structure image classification model are cascaded through adaptive average pooling layers, and the cascaded outputs are connected to fully connected layers, increasing low-dimensional feature information.

[0094] The serum status identification device provided in the embodiments of the present invention will be described below. The serum status identification device described below can be referred to in correspondence with the serum status identification method described above.

[0095] Please refer to the details. Figure 4 , Figure 4 A schematic diagram of a serum status identification device provided in an embodiment of the present invention may include:

[0096] The acquisition module 100 is used to acquire images of blood collection tubes containing serum and use them as sample images;

[0097] The target detection module 200 is used to detect the sample image using a target detection algorithm to obtain a whole blood region image;

[0098] The region segmentation module 300 is used to segment the whole blood region image using a segmentation algorithm to obtain a serum region image;

[0099] Preprocessing module 400 is used to preprocess the serum region image to obtain a preprocessed serum region image, wherein the preprocessing includes compression processing;

[0100] The image recognition module 500 is used to identify the preprocessed serum region image using an improved ResNet50 network structure image classification model to determine the serum status.

[0101] Based on the above embodiments, the region segmentation module 300 may include:

[0102] The grayscale processing unit is used to perform grayscale processing on the whole blood region image to obtain a grayscale image;

[0103] The smoothing unit is used to smooth the grayscale image using Gaussian filtering to obtain a smoothed image;

[0104] A threshold determination unit is used to calculate the image histogram of the smoothed image and determine the threshold based on the valleys of the image histogram.

[0105] The binarization processing unit is used to perform binarization processing and morphological opening operation on the smoothed image using the threshold to obtain a binarized image;

[0106] The upper boundary value determination unit is used to calculate the bounding rectangle corresponding to the largest area in the binarized image to obtain the upper boundary value of the blood clot region.

[0107] The cropping unit is used to determine the cropping interval based on the upper boundary value of the blood clot region, and to crop the whole blood region image according to the cropping interval to obtain the serum region image.

[0108] Based on the above embodiments, the threshold determination unit may include:

[0109] The statistics subunit is used to count the number of pixels corresponding to each gray value in the image histogram to obtain a statistical value array;

[0110] The first calculation subunit is used to calculate the difference between adjacent values ​​in the statistical value array and determine the fluctuation point based on the difference;

[0111] A filtering subunit is used to filter the fluctuation points to obtain a first array;

[0112] The second calculation subunit is used to calculate the first peak information, the first trough information, the second peak information and the second trough information according to the first array. The first peak information includes the gray value and statistical value corresponding to the first peak. The first trough information includes the gray value and statistical value corresponding to the first trough. The second peak information includes the gray value and statistical value corresponding to the second peak. The second trough information includes the gray value and statistical value corresponding to the second trough.

[0113] The judgment subunit is configured to determine the threshold value when the ratio of the statistical value corresponding to the second peak to the statistical value corresponding to the first peak is greater than a first preset value or the difference between the gray value corresponding to the first trough and the gray value corresponding to the first peak is less than a second preset value; otherwise, the gray value corresponding to the first trough is the threshold value.

[0114] Based on the above embodiments, the preprocessing module 400 may include:

[0115] A detail processing unit is used to perform detail processing on the serum region image using an automatic contrast algorithm to obtain a first image;

[0116] A compression unit is used to compress the first image without changing its size to obtain the preprocessed serum region image.

[0117] Based on any of the above embodiments, the image recognition module 500 may include:

[0118] The recognition unit is used to recognize the serum region image using the improved ResNet50 network structure image classification model and determine the recognition result. The improved ResNet50 network structure image classification model includes two residual modules in each of the first, second, third and fourth stages, and the residual modules include attention mechanism modules.

[0119] Based on the above embodiments, the improved ResNet50 network structure image classification model in the image recognition module 500 further includes:

[0120] A connection unit is used for cascading the outputs of the second, third, and fourth stages of the improved ResNet50 network structure image classification model after passing through an adaptive average pooling layer, and the cascaded output is connected to a fully connected layer.

[0121] Based on the above embodiments, the target detection module 200 may include:

[0122] The target detection unit is used to detect the sample image using the YOLOv5s target detection model to obtain the whole blood region image.

[0123] It should be noted that the order of the modules and units in the serum status recognition device can be changed without affecting the logic.

[0124] The serum status identification device provided in this embodiment of the invention comprises: an acquisition module 100 for acquiring an image of a blood collection tube containing serum, which serves as a sample image; a target detection module 200 for detecting the sample image using a target detection algorithm to obtain a whole blood region image; a region segmentation module 300 for segmenting the whole blood region image using a segmentation algorithm to obtain a serum region image; a preprocessing module 400 for preprocessing the serum region image to obtain a preprocessed serum region image, including compression processing; and an image recognition module 500 for recognizing the preprocessed serum region image using an improved ResNet50 network structure image classification model to determine the serum status. This device uses a combination of machine vision and deep learning to accurately identify the serum status in blood collection tubes. It can accurately identify the serum status before the sampling needle draws serum, filter abnormal serum samples, avoid needle clogging, and is compatible with various sizes of blood collection tubes and those containing separating gel. It can accurately identify abnormal states such as fibrin threads and blood clots in the serum collected from the blood collection tubes. Furthermore, the YOLOv5s object detection model ensures effective object detection. A series of processing steps on the whole blood region image enables more effective segmentation. Thresholds are calculated by filtering fluctuation points, improving the segmentation threshold and image segmentation accuracy. Detail processing and non-variable size compression of the serum region image enhance recognition accuracy. Each stage of the classification model includes two residual modules, each containing an attention mechanism, ensuring recognition accuracy while accelerating model inference. The outputs of the second, third, and fourth stages of the improved ResNet50 network structure image classification model are cascaded through adaptive average pooling layers, and the cascaded outputs are connected to fully connected layers, increasing low-dimensional feature information.

[0125] The serum status identification device provided in the embodiments of the present invention will be described below. The serum status identification device described below can be referred to in correspondence with the serum status identification method described above.

[0126] Please refer to Figure 5 , Figure 5 A schematic diagram of a serum status identification device provided in an embodiment of the present invention may include:

[0127] Memory 10 is used to store computer programs;

[0128] Processor 20 is used to execute computer programs to implement the serum status identification method described above.

[0129] The system includes a memory 10, a processor 20, a communication interface 31, and a communication bus 32. The memory 10, processor 20, and communication interface 31 communicate with each other through the communication bus 32.

[0130] In this embodiment of the invention, the memory 10 is used to store one or more programs. The programs may include program code, which includes computer operation instructions. In this embodiment, the memory 10 may store programs for implementing the following functions:

[0131] Acquire images of blood collection tubes filled with serum and use them as sample images;

[0132] The sample image was detected using an object detection algorithm to obtain a whole blood region image;

[0133] The whole blood region image is segmented using a segmentation algorithm to obtain the serum region image;

[0134] The serum region image is preprocessed to obtain a preprocessed serum region image. The preprocessing includes compression.

[0135] An improved ResNet50 network structure image classification model was used to identify preprocessed serum region images and determine the serum status.

[0136] In one possible implementation, the memory 10 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; and the data storage area may store data created during use.

[0137] Furthermore, memory 10 may include read-only memory and random access memory, providing instructions and data to the processor. A portion of the memory may also include NVRAM. The memory stores operating systems and operating instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operating instructions may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic tasks and handling hardware-based tasks.

[0138] Processor 20 can be a central processing unit (CPU), an application-specific integrated circuit, a digital signal processor, a field-programmable gate array, or other programmable logic device. Processor 20 can be a microprocessor or any conventional processor. Processor 20 can call programs stored in memory 10.

[0139] Communication interface 31 can be an interface for the communication module, used to connect with other devices or systems.

[0140] Of course, it should be noted that, Figure 5 The structure shown does not constitute a limitation on the serum status identification device in the embodiments of this application. In practical applications, the serum status identification device may include more than Figure 5 More or fewer components as shown, or combinations of certain components.

[0141] The storage medium provided in the embodiments of the present invention is described below. The storage medium described below can be referred to in correspondence with the serum status identification method described above.

[0142] The present invention also provides a storage medium storing a computer program, which, when executed by a processor, implements the steps of the serum status identification method described above.

[0143] The storage medium can include various media that can store program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0145] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0146] Finally, it should be noted that in this document, relationships such as "first" and "second" are used merely 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 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.

[0147] The present invention provides a detailed description of a serum status identification method, apparatus, device, and storage medium. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A serum state recognition method characterized by comprising: The method comprises the following steps: An image of a blood collection tube containing serum is acquired as a sample image; A target detection algorithm is used to detect the sample image to obtain a whole blood region image; A segmentation algorithm is used to segment the whole blood region image to obtain a serum region image; The serum region image is preprocessed to obtain a preprocessed serum region image, and the preprocessing includes compression processing; An improved Resnet50 network structure image classification model is used to identify the preprocessed serum region image to determine the serum state. The segmentation algorithm is used to segment the whole blood region image to obtain the serum region image, which comprises the following steps: The whole blood region image is subjected to grayscale processing to obtain a grayscale image; The grayscale image is subjected to smoothing processing using a Gaussian filter to obtain a smoothed image; An image histogram of the smoothed image is calculated, and a threshold value is determined according to a trough of the image histogram; The smoothed image is subjected to binaryzation processing and morphological opening operation using the threshold value to obtain a binaryzation image; The maximum area corresponding to the circumscribed rectangle of the binaryzation image is calculated to obtain an upper boundary value of a blood clot region; The serum region image is obtained by determining a cutting interval according to the upper boundary value of the blood clot region and cutting the whole blood region image according to the cutting interval. The image histogram of the smoothed image is calculated, and the threshold value is determined according to the trough of the image histogram, which comprises the following steps: The number of pixels corresponding to each grayscale value in the image histogram is counted to obtain a statistical value array; The difference between adjacent values in the statistical value array is calculated, and fluctuation points are determined according to the difference; The fluctuation points are filtered to obtain a first array; First peak information, first trough information, second peak information, and second trough information are calculated according to the first array, the first peak information includes the grayscale value and statistical value corresponding to the first peak, the first trough information includes the grayscale value and statistical value corresponding to the first trough, the second peak information includes the grayscale value and statistical value corresponding to the second peak, and the second trough information includes the grayscale value and statistical value corresponding to the second trough; When the ratio of the statistical value corresponding to the second peak to the statistical value corresponding to the first peak is greater than a first preset value, or the difference between the grayscale value corresponding to the first trough and the grayscale value corresponding to the first peak is less than a second preset value, the grayscale value corresponding to the second trough is the threshold value; otherwise, the grayscale value corresponding to the first trough is the threshold value.

2. The serum state recognition method according to claim 1, characterized by, The preprocessing of the serum region image to obtain the preprocessed serum region image includes compression processing, which comprises the following steps: An automatic contrast algorithm is used to process the details of the serum region image to obtain a first image; The first image is subjected to non-distortion size compression to obtain the preprocessed serum region image.

3. The serum state recognition method according to any one of claims 1 to 2, characterized by, The improved Resnet50 network structure image classification model is used to identify the preprocessed serum region image, and the serum state is determined. The improved Resnet50 network structure image classification model comprises two residual modules in each of the first stage, the second stage, the third stage and the fourth stage, and the residual module comprises an attention mechanism module; The improved Resnet50 network structure image classification model is used for identifying the serum region image, and an identification result is determined.

4. The serum state recognition method according to claim 3, characterized by, The improved Resnet50 network structure image classification model further comprises: The outputs of the second stage, the third stage and the fourth stage of the improved Resnet50 network structure image classification model are cascaded after being subjected to adaptive average pooling layers, and the cascaded output is connected with a full connection layer.

5. The serum state recognition method according to claim 1, characterized by, The target detection algorithm is used for detecting the sample image, and a whole blood region image is obtained. The YOLOv5s target detection model is used for detecting the sample image, and the whole blood region image is obtained.

6. A serum state recognition device characterized by comprising: It comprises: An acquisition module is configured to acquire a blood collection tube image containing serum and use the image as a sample image; A target detection module is configured to use a target detection algorithm to detect the sample image and obtain a whole blood region image; A region segmentation module is configured to use a segmentation algorithm to segment the whole blood region image and obtain a serum region image; A preprocessing module is configured to preprocess the serum region image and obtain a preprocessed serum region image, wherein the preprocessing comprises compression processing; An image recognition module is configured to use an improved Resnet50 network structure image classification model to identify the preprocessed serum region image and determine a serum state; The region segmentation module comprises: A grayscale processing unit is configured to perform grayscale processing on the whole blood region image and obtain a grayscale image; A smoothing processing unit is configured to use a Gaussian filter to perform smoothing processing on the grayscale image and obtain a smoothed image; A threshold determination unit is configured to calculate an image histogram of the smoothed image, determine a threshold value according to a trough of the image histogram, and obtain a binary image by using the threshold value to perform binary processing and morphological opening operation on the smoothed image; An upper boundary value determination unit is configured to calculate a circumscribed rectangle corresponding to a maximum area in the binary image and obtain an upper boundary value of a blood clot region; A cutting unit is configured to determine a cutting interval according to the upper boundary value of the blood clot region, cut the whole blood region image according to the cutting interval, and obtain the serum region image; The threshold determination unit comprises: A statistical subunit is configured to count the number of pixels corresponding to each grayscale value in the image histogram and obtain a statistical value array; A first calculation subunit is configured to calculate the difference between adjacent values in the statistical value array and determine fluctuation points according to the difference; A filtering subunit is configured to filter the fluctuation points and obtain a first array; ​ The second calculating subunit is configured to calculate first peak information, first valley information, second peak information and second valley information according to the first array, wherein the first peak information comprises a gray value and a statistical value corresponding to the first peak, the first valley information comprises a gray value and a statistical value corresponding to the first valley, the second peak information comprises a gray value and a statistical value corresponding to the second peak, and the second valley information comprises a gray value and a statistical value corresponding to the second valley. The judging subunit is configured to determine that the gray value of the second valley is the threshold value when a ratio of the statistical value corresponding to the second peak to the statistical value corresponding to the first peak is greater than a first preset value or a difference between the gray value corresponding to the first valley and the gray value corresponding to the first peak is less than a second preset value; otherwise, the gray value of the first valley is the threshold value.

7. A serum state recognition apparatus characterized by comprising: The method comprises the following steps: a memory configured to store a computer program; a processor configured to execute the computer program to implement the steps of the serum state recognition method according to any one of claims 1 to 5.

8. A storage medium, characterized by The storage medium has a computer program stored thereon, and the computer program is executed by the processor to implement the steps of the serum state recognition method according to any one of claims 1 to

Citation Information

Patent Citations

  • Pathological image classification method, equipment, system and storage medium

    CN114037699A